This commit is contained in:
syuilo
2021-12-09 23:58:30 +09:00
parent 0abe2dfee0
commit c69b72e199
573 changed files with 3318 additions and 3318 deletions

View File

@@ -15,21 +15,21 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
}
},
},
errors: {
noSuchUser: {
message: 'No such user.',
code: 'NO_SUCH_USER',
id: '66ce1645-d66c-46bb-8b79-96739af885bd'
id: '66ce1645-d66c-46bb-8b79-96739af885bd',
},
noFollowRequest: {
message: 'No follow request.',
code: 'NO_FOLLOW_REQUEST',
id: 'bcde4f8b-0913-4614-8881-614e522fb041'
id: 'bcde4f8b-0913-4614-8881-614e522fb041',
},
}
},
};
export default define(meta, async (ps, user) => {

View File

@@ -16,28 +16,28 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
}
},
},
errors: {
noSuchUser: {
message: 'No such user.',
code: 'NO_SUCH_USER',
id: '4e68c551-fc4c-4e46-bb41-7d4a37bf9dab'
id: '4e68c551-fc4c-4e46-bb41-7d4a37bf9dab',
},
followRequestNotFound: {
message: 'Follow request not found.',
code: 'FOLLOW_REQUEST_NOT_FOUND',
id: '089b125b-d338-482a-9a09-e2622ac9f8d4'
id: '089b125b-d338-482a-9a09-e2622ac9f8d4',
},
},
res: {
type: 'object' as const,
optional: false as const, nullable: false as const,
ref: 'User'
}
ref: 'User',
},
};
export default define(meta, async (ps, user) => {

View File

@@ -18,26 +18,26 @@ export const meta = {
id: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id'
format: 'id',
},
follower: {
type: 'object' as const,
optional: false as const, nullable: false as const,
ref: 'User'
ref: 'User',
},
followee: {
type: 'object' as const,
optional: false as const, nullable: false as const,
ref: 'User'
}
}
}
}
ref: 'User',
},
},
},
},
};
export default define(meta, async (ps, user) => {
const reqs = await FollowRequests.find({
followeeId: user.id
followeeId: user.id,
});
return await Promise.all(reqs.map(req => FollowRequests.pack(req)));

View File

@@ -15,16 +15,16 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
}
},
},
errors: {
noSuchUser: {
message: 'No such user.',
code: 'NO_SUCH_USER',
id: 'abc2ffa6-25b2-4380-ba99-321ff3a94555'
id: 'abc2ffa6-25b2-4380-ba99-321ff3a94555',
},
}
},
};
export default define(meta, async (ps, user) => {