Add getLabelsByIds service method

This commit is contained in:
Hongbo Wu 2022-06-08 14:59:27 +08:00
parent 93c0e53d1d
commit eef3ee4114

View file

@ -66,3 +66,13 @@ export const addLabelToPage = async (
ctx
)
}
export const getLabelsByIds = async (
userId: string,
labelIds: string[]
): Promise<Label[]> => {
return getRepository(Label).find({
where: { id: In(labelIds), user: { id: userId } },
select: ['id', 'name', 'color', 'description', 'createdAt'],
})
}