fix: database problem

This commit is contained in:
아르페 2024-02-16 15:58:23 +09:00 committed by 무라쿠모
parent 5d0012ceac
commit a87776f41e
No known key found for this signature in database
GPG key ID: 139D6573F92DA9F7
7 changed files with 38 additions and 75 deletions

View file

@ -138,13 +138,6 @@ export class SignupService {
if (exist) throw new Error(' the username is already used');
const condition = await transactionalEntityManager.save(new MiAutoRemovalCondition({
id: this.idService.gen(),
deleteAfter: 7,
noPiningNotes: false,
noSpecifiedNotes: false,
}));
account = await transactionalEntityManager.save(new MiUser({
id: this.idService.gen(),
username: username,
@ -152,11 +145,16 @@ export class SignupService {
host: this.utilityService.toPunyNullable(host),
token: secret,
autoRemoval: false,
autoRemovalConditionId: condition.id,
autoRemovalCondition: condition,
isRoot: isTheFirstUser,
}));
await transactionalEntityManager.save(new MiAutoRemovalCondition({
userId: account.id,
deleteAfter: 7,
noPiningNotes: false,
noSpecifiedNotes: false,
}));
await transactionalEntityManager.save(new MiUserKeypair({
publicKey: keyPair[0],
privateKey: keyPair[1],