enhance: 使われてないアンテナは自動停止されるように

Resolve #9373
This commit is contained in:
syuilo
2023-03-20 20:12:38 +09:00
parent eb5781465b
commit 54630edb0f
9 changed files with 59 additions and 4 deletions

View File

@ -103,9 +103,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
}
}
const now = new Date();
const antenna = await this.antennasRepository.insert({
id: this.idService.genId(),
createdAt: new Date(),
createdAt: now,
lastUsedAt: now,
userId: me.id,
name: ps.name,
src: ps.src,

View File

@ -101,6 +101,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
this.noteReadService.read(me.id, notes);
}
this.antennasRepository.update(antenna.id, {
lastUsedAt: new Date(),
});
return await this.noteEntityService.packMany(notes, me);
});
}