feat: 時限ミュート

#7677
This commit is contained in:
syuilo
2022-03-04 20:23:53 +09:00
parent 82f9d5501b
commit e68278f93e
12 changed files with 116 additions and 6 deletions

View File

@ -14,6 +14,13 @@ export class Muting {
})
public createdAt: Date;
@Index()
@Column('timestamp with time zone', {
nullable: true,
default: null,
})
public expiresAt: Date | null;
@Index()
@Column({
...id(),

View File

@ -16,6 +16,7 @@ export class MutingRepository extends Repository<Muting> {
return await awaitAll({
id: muting.id,
createdAt: muting.createdAt.toISOString(),
expiresAt: muting.expiresAt ? muting.expiresAt.toISOString() : null,
muteeId: muting.muteeId,
mutee: Users.pack(muting.muteeId, me, {
detail: true,

View File

@ -12,6 +12,11 @@ export const packedMutingSchema = {
optional: false, nullable: false,
format: 'date-time',
},
expiresAt: {
type: 'string',
optional: false, nullable: true,
format: 'date-time',
},
muteeId: {
type: 'string',
optional: false, nullable: false,