fix lint
This commit is contained in:
@@ -12,7 +12,7 @@ export const meta = {
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
max: 100,
|
||||
},
|
||||
|
||||
requireCredential: true as const,
|
||||
@@ -22,46 +22,46 @@ export const meta = {
|
||||
params: {
|
||||
userId: {
|
||||
validator: $.type(ID),
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
errors: {
|
||||
noSuchUser: {
|
||||
message: 'No such user.',
|
||||
code: 'NO_SUCH_USER',
|
||||
id: 'fcd2eef9-a9b2-4c4f-8624-038099e90aa5'
|
||||
id: 'fcd2eef9-a9b2-4c4f-8624-038099e90aa5',
|
||||
},
|
||||
|
||||
followeeIsYourself: {
|
||||
message: 'Followee is yourself.',
|
||||
code: 'FOLLOWEE_IS_YOURSELF',
|
||||
id: '26fbe7bb-a331-4857-af17-205b426669a9'
|
||||
id: '26fbe7bb-a331-4857-af17-205b426669a9',
|
||||
},
|
||||
|
||||
alreadyFollowing: {
|
||||
message: 'You are already following that user.',
|
||||
code: 'ALREADY_FOLLOWING',
|
||||
id: '35387507-38c7-4cb9-9197-300b93783fa0'
|
||||
id: '35387507-38c7-4cb9-9197-300b93783fa0',
|
||||
},
|
||||
|
||||
blocking: {
|
||||
message: 'You are blocking that user.',
|
||||
code: 'BLOCKING',
|
||||
id: '4e2206ec-aa4f-4960-b865-6c23ac38e2d9'
|
||||
id: '4e2206ec-aa4f-4960-b865-6c23ac38e2d9',
|
||||
},
|
||||
|
||||
blocked: {
|
||||
message: 'You are blocked by that user.',
|
||||
code: 'BLOCKED',
|
||||
id: 'c4ab57cc-4e41-45e9-bfd9-584f61e35ce0'
|
||||
id: 'c4ab57cc-4e41-45e9-bfd9-584f61e35ce0',
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
ref: 'User'
|
||||
}
|
||||
ref: 'User',
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
@@ -81,7 +81,7 @@ export default define(meta, async (ps, user) => {
|
||||
// Check if already following
|
||||
const exist = await Followings.findOne({
|
||||
followerId: follower.id,
|
||||
followeeId: followee.id
|
||||
followeeId: followee.id,
|
||||
});
|
||||
|
||||
if (exist != null) {
|
||||
|
||||
@@ -12,7 +12,7 @@ export const meta = {
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
max: 100,
|
||||
},
|
||||
|
||||
requireCredential: true as const,
|
||||
@@ -22,34 +22,34 @@ export const meta = {
|
||||
params: {
|
||||
userId: {
|
||||
validator: $.type(ID),
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
errors: {
|
||||
noSuchUser: {
|
||||
message: 'No such user.',
|
||||
code: 'NO_SUCH_USER',
|
||||
id: '5b12c78d-2b28-4dca-99d2-f56139b42ff8'
|
||||
id: '5b12c78d-2b28-4dca-99d2-f56139b42ff8',
|
||||
},
|
||||
|
||||
followeeIsYourself: {
|
||||
message: 'Followee is yourself.',
|
||||
code: 'FOLLOWEE_IS_YOURSELF',
|
||||
id: 'd9e400b9-36b0-4808-b1d8-79e707f1296c'
|
||||
id: 'd9e400b9-36b0-4808-b1d8-79e707f1296c',
|
||||
},
|
||||
|
||||
notFollowing: {
|
||||
message: 'You are not following that user.',
|
||||
code: 'NOT_FOLLOWING',
|
||||
id: '5dbf82f5-c92b-40b1-87d1-6c8c0741fd09'
|
||||
id: '5dbf82f5-c92b-40b1-87d1-6c8c0741fd09',
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
ref: 'User'
|
||||
}
|
||||
ref: 'User',
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
@@ -69,7 +69,7 @@ export default define(meta, async (ps, user) => {
|
||||
// Check not following
|
||||
const exist = await Followings.findOne({
|
||||
followerId: follower.id,
|
||||
followeeId: followee.id
|
||||
followeeId: followee.id,
|
||||
});
|
||||
|
||||
if (exist == null) {
|
||||
|
||||
@@ -12,7 +12,7 @@ export const meta = {
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
max: 100,
|
||||
},
|
||||
|
||||
requireCredential: true as const,
|
||||
@@ -22,34 +22,34 @@ export const meta = {
|
||||
params: {
|
||||
userId: {
|
||||
validator: $.type(ID),
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
errors: {
|
||||
noSuchUser: {
|
||||
message: 'No such user.',
|
||||
code: 'NO_SUCH_USER',
|
||||
id: '5b12c78d-2b28-4dca-99d2-f56139b42ff8'
|
||||
id: '5b12c78d-2b28-4dca-99d2-f56139b42ff8',
|
||||
},
|
||||
|
||||
followerIsYourself: {
|
||||
message: 'Follower is yourself.',
|
||||
code: 'FOLLOWER_IS_YOURSELF',
|
||||
id: '07dc03b9-03da-422d-885b-438313707662'
|
||||
id: '07dc03b9-03da-422d-885b-438313707662',
|
||||
},
|
||||
|
||||
notFollowing: {
|
||||
message: 'The other use is not following you.',
|
||||
code: 'NOT_FOLLOWING',
|
||||
id: '5dbf82f5-c92b-40b1-87d1-6c8c0741fd09'
|
||||
id: '5dbf82f5-c92b-40b1-87d1-6c8c0741fd09',
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
ref: 'User'
|
||||
}
|
||||
ref: 'User',
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
@@ -69,7 +69,7 @@ export default define(meta, async (ps, user) => {
|
||||
// Check not following
|
||||
const exist = await Followings.findOne({
|
||||
followerId: follower.id,
|
||||
followeeId: followee.id
|
||||
followeeId: followee.id,
|
||||
});
|
||||
|
||||
if (exist == null) {
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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)));
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user