diff --git a/samples/web-csr/dressca-frontend/admin/mock/handlers/assets.ts b/samples/web-csr/dressca-frontend/admin/mock/handlers/assets.ts index ecb371100..7bdbf753a 100644 --- a/samples/web-csr/dressca-frontend/admin/mock/handlers/assets.ts +++ b/samples/web-csr/dressca-frontend/admin/mock/handlers/assets.ts @@ -1,3 +1,4 @@ +import { HttpStatusCode } from 'axios'; import { HttpResponse, http } from 'msw'; export const assetsHandlers = [ @@ -6,7 +7,7 @@ export const assetsHandlers = [ `/mock/images/${params.assetCode}.png`, ).then((response) => response.arrayBuffer()); return HttpResponse.arrayBuffer(imageBuffer, { - status: 200, + status: HttpStatusCode.Ok, headers: { 'Content-Type': 'image/png', }, diff --git a/samples/web-csr/dressca-frontend/admin/mock/handlers/catalogBrands.ts b/samples/web-csr/dressca-frontend/admin/mock/handlers/catalogBrands.ts index 81ba30243..8e4b79a12 100644 --- a/samples/web-csr/dressca-frontend/admin/mock/handlers/catalogBrands.ts +++ b/samples/web-csr/dressca-frontend/admin/mock/handlers/catalogBrands.ts @@ -1,4 +1,5 @@ import type { GetCatalogBrandsResponse } from '@/generated/api-client'; +import { HttpStatusCode } from 'axios'; import { HttpResponse, http } from 'msw'; const catalogBrands: GetCatalogBrandsResponse[] = [ @@ -18,6 +19,6 @@ const catalogBrands: GetCatalogBrandsResponse[] = [ export const catalogBrandsHandlers = [ http.get('/api/catalog-brands', () => { - return HttpResponse.json(catalogBrands, { status: 200 }); + return HttpResponse.json(catalogBrands, { status: HttpStatusCode.Ok }); }), ]; diff --git a/samples/web-csr/dressca-frontend/admin/mock/handlers/catalogCategories.ts b/samples/web-csr/dressca-frontend/admin/mock/handlers/catalogCategories.ts index 93b1ca436..ac23fb4b0 100644 --- a/samples/web-csr/dressca-frontend/admin/mock/handlers/catalogCategories.ts +++ b/samples/web-csr/dressca-frontend/admin/mock/handlers/catalogCategories.ts @@ -1,4 +1,5 @@ import type { GetCatalogCategoriesResponse } from '@/generated/api-client'; +import { HttpStatusCode } from 'axios'; import { HttpResponse, http } from 'msw'; const catalogCategories: GetCatalogCategoriesResponse[] = [ @@ -18,6 +19,6 @@ const catalogCategories: GetCatalogCategoriesResponse[] = [ export const catalogCategoriesHandlers = [ http.get('/api/catalog-categories', () => { - return HttpResponse.json(catalogCategories, { status: 200 }); + return HttpResponse.json(catalogCategories, { status: HttpStatusCode.Ok }); }), ]; diff --git a/samples/web-csr/dressca-frontend/admin/mock/handlers/catalogItems.ts b/samples/web-csr/dressca-frontend/admin/mock/handlers/catalogItems.ts index f4e7f8a43..aa43dcba1 100644 --- a/samples/web-csr/dressca-frontend/admin/mock/handlers/catalogItems.ts +++ b/samples/web-csr/dressca-frontend/admin/mock/handlers/catalogItems.ts @@ -3,7 +3,7 @@ import type { PostCatalogItemRequest, PutCatalogItemRequest, } from '@/generated/api-client'; -import { HttpStatusCode } from './httpStatusCode'; +import { HttpStatusCode } from 'axios'; import { pagedListCatalogItem, catalogItems } from '../data/catalogItems'; type GetCatalogItemParams = { diff --git a/samples/web-csr/dressca-frontend/admin/mock/handlers/httpStatusCode.ts b/samples/web-csr/dressca-frontend/admin/mock/handlers/httpStatusCode.ts deleted file mode 100644 index 1c8d6cbaf..000000000 --- a/samples/web-csr/dressca-frontend/admin/mock/handlers/httpStatusCode.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum HttpStatusCode { - Ok = 200, - Created = 201, - NoContent = 204, -} diff --git a/samples/web-csr/dressca-frontend/admin/mock/handlers/users.ts b/samples/web-csr/dressca-frontend/admin/mock/handlers/users.ts index 2f4aa9784..7dd5668df 100644 --- a/samples/web-csr/dressca-frontend/admin/mock/handlers/users.ts +++ b/samples/web-csr/dressca-frontend/admin/mock/handlers/users.ts @@ -1,5 +1,6 @@ import { HttpResponse, http } from 'msw'; import type { GetLoginUserResponse } from '@/generated/api-client'; +import { HttpStatusCode } from 'axios'; const user: GetLoginUserResponse = { userName: 'admin@example.com', @@ -8,6 +9,6 @@ const user: GetLoginUserResponse = { export const usersHandlers = [ http.get('/api/users', () => { - return HttpResponse.json(user, { status: 200 }); + return HttpResponse.json(user, { status: HttpStatusCode.Ok }); }), ];