mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
resolve conflicts
This commit is contained in:
parent
b2fbbfb073
commit
e696709a69
1 changed files with 8 additions and 0 deletions
|
|
@ -28,6 +28,7 @@ import {
|
|||
UpdateLabelSuccess,
|
||||
} from '../../generated/graphql'
|
||||
import { labelRepository } from '../../repository/label'
|
||||
import { userRepository } from '../../repository/user'
|
||||
import {
|
||||
findOrCreateLabels,
|
||||
saveLabelsInHighlight,
|
||||
|
|
@ -40,6 +41,13 @@ import { authorized } from '../../utils/helpers'
|
|||
export const labelsResolver = authorized<LabelsSuccess, LabelsError>(
|
||||
async (_obj, _params, { authTrx, log, uid }) => {
|
||||
try {
|
||||
const user = await userRepository.findById(uid)
|
||||
if (!user) {
|
||||
return {
|
||||
errorCodes: [LabelsErrorCode.Unauthorized],
|
||||
}
|
||||
}
|
||||
|
||||
const labels = await authTrx(async (tx) => {
|
||||
return tx.withRepository(labelRepository).find({
|
||||
order: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue