trim mandatory CWs

This commit is contained in:
Hazelnoot 2025-09-11 14:34:44 -04:00
parent 5cb94e3c60
commit d960c4b863
3 changed files with 3 additions and 3 deletions

View file

@ -35,7 +35,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const instance = await this.federatedInstanceService.fetchOrRegister(ps.host);
// Collapse empty strings to null
const newCW = ps.cw || null;
const newCW = ps.cw?.trim() || null;
const oldCW = instance.mandatoryCW;
// Skip if there's nothing to do

View file

@ -43,7 +43,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}) as MiNote & { user: MiUser };
// Collapse empty strings to null
const newCW = ps.cw || null;
const newCW = ps.cw?.trim() || null;
const oldCW = note.mandatoryCW;
// Skip if there's nothing to do

View file

@ -42,7 +42,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const user = await this.cacheService.findUserById(ps.userId);
// Collapse empty strings to null
const newCW = ps.cw || null;
const newCW = ps.cw?.trim() || null;
const oldCW = user.mandatoryCW;
// Skip if there's nothing to do