mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add getLabelsByIds service method
This commit is contained in:
parent
93c0e53d1d
commit
eef3ee4114
1 changed files with 10 additions and 0 deletions
|
|
@ -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'],
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue