forked from FoundKeyGang/FoundKey
server: improve error message for invalidating follows
This error was broken out to be a separate error code and message. Changelog: Changed
This commit is contained in:
parent
d6837814d9
commit
32beda4344
2 changed files with 6 additions and 2 deletions
|
@ -17,7 +17,7 @@ export const meta = {
|
||||||
|
|
||||||
kind: 'write:following',
|
kind: 'write:following',
|
||||||
|
|
||||||
errors: ['FOLLOWER_IS_YOURSELF', 'NO_SUCH_USER', 'NOT_FOLLOWING'],
|
errors: ['FOLLOWER_IS_YOURSELF', 'NO_SUCH_USER', 'NOT_FOLLOWED'],
|
||||||
|
|
||||||
res: {
|
res: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
@ -53,7 +53,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
followeeId: followee.id,
|
followeeId: followee.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!exist) throw new ApiError('NOT_FOLLOWING');
|
if (!exist) throw new ApiError('NOT_FOLLOWED');
|
||||||
|
|
||||||
await deleteFollowing(follower, followee);
|
await deleteFollowing(follower, followee);
|
||||||
|
|
||||||
|
|
|
@ -340,6 +340,10 @@ export const errors: Record<string, { message: string, httpStatusCode: number }>
|
||||||
message: 'You are not following that user.',
|
message: 'You are not following that user.',
|
||||||
httpStatusCode: 409,
|
httpStatusCode: 409,
|
||||||
},
|
},
|
||||||
|
NOT_FOLLOWED: {
|
||||||
|
message: 'You are not followed by that user.',
|
||||||
|
httpStatusCode: 409,
|
||||||
|
},
|
||||||
NOT_LIKED: {
|
NOT_LIKED: {
|
||||||
message: 'You have not liked that page.',
|
message: 'You have not liked that page.',
|
||||||
httpStatusCode: 409,
|
httpStatusCode: 409,
|
||||||
|
|
Loading…
Reference in a new issue