re-fetch notes after create/edit to ensure they have all fields populated
This commit is contained in:
@@ -227,7 +227,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async create(user: MiUser & {
|
||||
public async create(user: MiUser & {
|
||||
id: MiUser['id'];
|
||||
username: MiUser['username'];
|
||||
host: MiUser['host'];
|
||||
@@ -539,7 +539,8 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||
await this.notesRepository.insert(insert);
|
||||
}
|
||||
|
||||
return insert;
|
||||
// Re-fetch note to get the default values of null / unset fields.
|
||||
return await this.notesRepository.findOneByOrFail({ id: insert.id });
|
||||
} catch (e) {
|
||||
// duplicate key error
|
||||
if (isDuplicateKeyValueError(e)) {
|
||||
|
||||
Reference in New Issue
Block a user