Skip to content

Commit

Permalink
throw not found when not found
Browse files Browse the repository at this point in the history
  • Loading branch information
tlgimenes committed Jun 7, 2022
1 parent 9c4d8b4 commit ae3484c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/api/src/platforms/vtex/resolvers/query.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { RedirectError, BadRequestError } from '../../errors'
import { BadRequestError, RedirectError, NotFoundError } from '../../errors'
import { mutateChannelContext, mutateLocaleContext } from '../utils/contex'
import { enhanceSku } from '../utils/enhanceSku'
import {
findChannel,
findLocale,
findSkuId,
findSlug,
transformSelectedFacet,
findSkuId,
} from '../utils/facets'
import { SORT_MAP } from '../utils/sort'
import { StoreCollection } from './collection'
Expand Down Expand Up @@ -60,7 +60,7 @@ export const Query = {
const location = skuId && `/${product.linkText}-${skuId}/p`

if (skuId == null) {
throw new BadRequestError(`Could not find product for slug ${slug}`)
throw new NotFoundError(`Could not find product for slug ${slug}`)
}

throw new RedirectError(301, location)
Expand Down

0 comments on commit ae3484c

Please sign in to comment.