Fix build and implement user/all correctly
This commit is contained in:
parent
a9bd803112
commit
555dacfaf5
17 changed files with 170 additions and 48 deletions
|
|
@ -7,6 +7,7 @@ import { RecipeDto } from "../dtos/RecipeDto.js";
|
|||
import { RecipeIngredientDtoEntityMapper } from "../mappers/RecipeIngredientDtoEntityMapper.js";
|
||||
import { RecipeIngredientGroupDtoEntityMapper } from "../mappers/RecipeIngredientGroupDtoEntityMapper.js";
|
||||
import { RecipeInstructionStepDtoEntityMapper } from "../mappers/RecipeInstructionStepDtoEntityMapper.js";
|
||||
import {HttpStatusCode} from "../apiHelpers/HttpStatusCodes.js";
|
||||
|
||||
/**
|
||||
* Handles all recipe related routes
|
||||
|
|
@ -35,7 +36,7 @@ router.post(
|
|||
asyncHandler(async(req, res) => {
|
||||
const requestDto: RecipeDto = req.body;
|
||||
const responseDto = await recipeHandler.createOrUpdateRecipe(requestDto);
|
||||
res.status(201).json(responseDto);
|
||||
res.status(HttpStatusCode.CREATED).json(responseDto);
|
||||
})
|
||||
)
|
||||
|
||||
|
|
@ -48,7 +49,7 @@ router.get(
|
|||
asyncHandler(async(req, res) => {
|
||||
const id = req.params.id;
|
||||
const responseDto = await recipeHandler.getRecipeById(id);
|
||||
res.status(201).json(responseDto);
|
||||
res.status(HttpStatusCode.OK).json(responseDto);
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue