implement optional confetti on announcements
This commit is contained in:
parent
69f3c8a58e
commit
45bf8262aa
12 changed files with 60 additions and 1 deletions
|
|
@ -78,6 +78,7 @@ export class AnnouncementService {
|
|||
forExistingUsers: values.forExistingUsers,
|
||||
silence: values.silence,
|
||||
needConfirmationToRead: values.needConfirmationToRead,
|
||||
confetti: values.confetti,
|
||||
userId: values.userId,
|
||||
});
|
||||
|
||||
|
|
@ -130,6 +131,7 @@ export class AnnouncementService {
|
|||
forExistingUsers: values.forExistingUsers,
|
||||
silence: values.silence,
|
||||
needConfirmationToRead: values.needConfirmationToRead,
|
||||
confetti: values.confetti,
|
||||
isActive: values.isActive,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ export class AnnouncementEntityService {
|
|||
forYou: announcement.userId === me?.id,
|
||||
needConfirmationToRead: announcement.needConfirmationToRead,
|
||||
silence: announcement.silence,
|
||||
confetti: announcement.confetti,
|
||||
isRead: announcement.isRead !== null ? announcement.isRead : undefined,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,12 @@ export class MiAnnouncement {
|
|||
})
|
||||
public silence: boolean;
|
||||
|
||||
@Index()
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
})
|
||||
public confetti: boolean;
|
||||
|
||||
@Index()
|
||||
@Column({
|
||||
...id(),
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ export const packedAnnouncementSchema = {
|
|||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
confetti: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
forYou: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ export const paramDef = {
|
|||
forExistingUsers: { type: 'boolean', default: false },
|
||||
silence: { type: 'boolean', default: false },
|
||||
needConfirmationToRead: { type: 'boolean', default: false },
|
||||
confetti: { type: 'boolean', default: false },
|
||||
userId: { type: 'string', format: 'misskey:id', nullable: true, default: null },
|
||||
},
|
||||
required: ['title', 'text', 'imageUrl'],
|
||||
|
|
@ -83,6 +84,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
forExistingUsers: ps.forExistingUsers,
|
||||
silence: ps.silence,
|
||||
needConfirmationToRead: ps.needConfirmationToRead,
|
||||
confetti: ps.confetti,
|
||||
userId: ps.userId,
|
||||
}, me);
|
||||
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
forExistingUsers: announcement.forExistingUsers,
|
||||
silence: announcement.silence,
|
||||
needConfirmationToRead: announcement.needConfirmationToRead,
|
||||
confetti: announcement.confetti,
|
||||
userId: announcement.userId,
|
||||
reads: reads.get(announcement)!,
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ export const paramDef = {
|
|||
forExistingUsers: { type: 'boolean' },
|
||||
silence: { type: 'boolean' },
|
||||
needConfirmationToRead: { type: 'boolean' },
|
||||
confetti: { type: 'boolean' },
|
||||
isActive: { type: 'boolean' },
|
||||
},
|
||||
required: ['id'],
|
||||
|
|
@ -67,6 +68,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
forExistingUsers: ps.forExistingUsers,
|
||||
silence: ps.silence,
|
||||
needConfirmationToRead: ps.needConfirmationToRead,
|
||||
confetti: ps.confetti,
|
||||
isActive: ps.isActive,
|
||||
}, me);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue