Skip to content

Commit

Permalink
fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadkitenge committed Apr 24, 2024
1 parent 2401a7f commit c5069e2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
1 change: 1 addition & 0 deletions src/app.types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface AddCatalogueCategoryWithPlacementIds
export interface EditCatalogueCategory {
name?: string;
id: string;
parent_id?: string | null;
}

export interface MoveToCatalogueCategory {
Expand Down
26 changes: 0 additions & 26 deletions src/mocks/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,6 @@ export const handlers = [
CatalogueCategory | ErrorResponse
>('/v1/catalogue-categories/:id', async ({ request, params }) => {
const { id } = params;
const itemData = CatalogueItemsJSON.filter(
(catalogueItem) => catalogueItem.catalogue_category_id === id
);

const catalogueData = CatalogueCategoriesJSON.filter(
(catalogueData) => catalogueData.parent_id === id
);

const obj = CatalogueCategoriesJSON.find(
(catalogueCategory) => catalogueCategory.id === id
Expand All @@ -161,25 +154,6 @@ export const handlers = [
{ status: 409 }
);
}
if (body.catalogue_item_properties !== undefined) {
if (itemData.length > 0) {
return HttpResponse.json(
{
detail:
'Catalogue category has child elements and cannot be updated',
},
{ status: 409 }
);
} else if (catalogueData.length > 0) {
return HttpResponse.json(
{
detail:
'Catalogue category has child elements and cannot be updated',
},
{ status: 409 }
);
}
}

if (fullBody.name === 'Error 500') {
return HttpResponse.json(
Expand Down

0 comments on commit c5069e2

Please sign in to comment.