fix: 🔒 cannot change note visibility
This commit is contained in:
parent
c7f98e381c
commit
91b1b5fb53
@ -140,7 +140,13 @@ export const meta = {
|
|||||||
code: "NOT_LOCAL_USER",
|
code: "NOT_LOCAL_USER",
|
||||||
id: "b907f407-2aa0-4283-800b-a2c56290b822",
|
id: "b907f407-2aa0-4283-800b-a2c56290b822",
|
||||||
},
|
},
|
||||||
},
|
|
||||||
|
cannotChangeVisibility: {
|
||||||
|
message: "You cannot change the visibility of a note.",
|
||||||
|
code: "CANNOT_CHANGE_VISIBILITY",
|
||||||
|
id: "2917fd0b-da04-41de-949f-146835a006c6",
|
||||||
|
},
|
||||||
|
}
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const paramDef = {
|
export const paramDef = {
|
||||||
@ -523,7 +529,8 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||||||
update.cw = null;
|
update.cw = null;
|
||||||
}
|
}
|
||||||
if (ps.visibility !== note.visibility) {
|
if (ps.visibility !== note.visibility) {
|
||||||
update.visibility = ps.visibility;
|
// update.visibility = ps.visibility;
|
||||||
|
throw new ApiError(meta.errors.cannotChangeVisibility);
|
||||||
}
|
}
|
||||||
if (ps.localOnly !== note.localOnly) {
|
if (ps.localOnly !== note.localOnly) {
|
||||||
update.localOnly = ps.localOnly;
|
update.localOnly = ps.localOnly;
|
||||||
|
Loading…
Reference in New Issue
Block a user