fix: align note edit errors with note create errors
This commit is contained in:
parent
15d2319011
commit
d1b787192a
2 changed files with 42 additions and 27 deletions
|
|
@ -51,6 +51,7 @@ import { CacheService } from '@/core/CacheService.js';
|
|||
import { isReply } from '@/misc/is-reply.js';
|
||||
import { trackPromise } from '@/misc/promise-tracker.js';
|
||||
import { isUserRelated } from '@/misc/is-user-related.js';
|
||||
import { IdentifiableError } from '@/misc/identifiable-error.js';
|
||||
|
||||
type NotificationType = 'reply' | 'renote' | 'quote' | 'mention' | 'edited';
|
||||
|
||||
|
|
@ -244,8 +245,7 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||
// we never want to change the replyId, so fetch the original "parent"
|
||||
if (oldnote.replyId) {
|
||||
data.reply = await this.notesRepository.findOneBy({ id: oldnote.replyId });
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
data.reply = undefined;
|
||||
}
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||
}
|
||||
|
||||
if (this.utilityService.isKeyWordIncluded(data.cw ?? data.text ?? '', meta.prohibitedWords)) {
|
||||
throw new NoteEditService.ContainsProhibitedWordsError();
|
||||
throw new IdentifiableError('689ee33f-f97c-479a-ac49-1b9f8140af99', 'Note contains prohibited words');
|
||||
}
|
||||
|
||||
const inSilencedInstance = this.utilityService.isSilencedHost((meta).silencedHosts, user.host);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue