wip: is post deletable?
This commit is contained in:
parent
5c19ac788e
commit
c3d05ed548
4 changed files with 11 additions and 1 deletions
|
@ -343,6 +343,7 @@ export class NoteEntityService implements OnModuleInit {
|
|||
reactionEmojis: this.customEmojiService.populateEmojis(reactionEmojiNames, host),
|
||||
reactionAndUserPairCache: opts.withReactionAndUserPairCache ? note.reactionAndUserPairCache : undefined,
|
||||
emojis: host != null ? this.customEmojiService.populateEmojis(note.emojis, host) : undefined,
|
||||
isDeletable: note.isDeletable,
|
||||
tags: note.tags.length > 0 ? note.tags : undefined,
|
||||
fileIds: note.fileIds,
|
||||
files: packedFiles != null ? this.packAttachedFiles(note.fileIds, packedFiles, me) : this.driveFileEntityService.packManyByIds(note.fileIds, me),
|
||||
|
|
|
@ -193,6 +193,11 @@ export class MiNote {
|
|||
})
|
||||
public hasPoll: boolean;
|
||||
|
||||
@Column('boolean', {
|
||||
default: true,
|
||||
})
|
||||
public isDeletable: boolean;
|
||||
|
||||
@Index()
|
||||
@Column({
|
||||
...id(),
|
||||
|
|
|
@ -255,7 +255,10 @@ export const packedNoteSchema = {
|
|||
type: 'number',
|
||||
optional: true, nullable: false,
|
||||
},
|
||||
|
||||
isDeletable: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
myReaction: {
|
||||
type: 'string',
|
||||
optional: true, nullable: true,
|
||||
|
|
|
@ -72,6 +72,7 @@ export class TruncateAccountProcessorService {
|
|||
const notes = await this.notesRepository.find({
|
||||
where: {
|
||||
userId: user.id,
|
||||
isDeletable: true,
|
||||
...(cursor ? {
|
||||
id: And(Not(In([...piningNoteIds, ...specifiedNoteIds])), MoreThan(cursor)),
|
||||
} : {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue