diff --git a/api/controllers/pastries-controller.js b/api/controllers/pastries-controller.js index 980cc4e..6706d1c 100644 --- a/api/controllers/pastries-controller.js +++ b/api/controllers/pastries-controller.js @@ -21,7 +21,7 @@ exports.addPastry = (req, res) => { exports.updatePastry = (req, res) => { const pastry = Data.pasteries.find(p => p.id === parseInt(req.params.id)); if (!pastry) return res.status(404).send('The pastry with the given ID was not found.'); - + pastry.name = req.body.name; pastry.bakingType = req.body.bakingType; pastry.startTime = req.body.startTime; pastry.duration = req.body.duration; @@ -38,4 +38,4 @@ exports.deletePastry = (req, res) => { Data.pasteries.splice(index, 1); res.status(204).send(); -}; \ No newline at end of file +}; diff --git a/frontend/src/core/container/app-container.ts b/frontend/src/core/container/app-container.ts index 6501154..7665257 100644 --- a/frontend/src/core/container/app-container.ts +++ b/frontend/src/core/container/app-container.ts @@ -6,13 +6,15 @@ import type { InjectionKey } from 'vue' import GetAppBakersUseCase from '../use-cases/app-bakers/get-app-bakers.use-case' import GetPastriesUseCase from '../use-cases/pastries/get-pastries.use-case' import AddPastryUseCase from '../use-cases/pastries/add-pastry.use-case' +import UpdatePastryUseCase from '../use-cases/pastries/update-pastry.use-case' export const AppContainerKey = { httpClient: Symbol('httpClient') as InjectionKey, remoteUseCaseProxy: Symbol('remoteUseCaseProxy') as InjectionKey, getAppBakersUseCase: Symbol('getAppBakersUseCase') as InjectionKey, getPastriesUseCase: Symbol('getPastriesUseCase') as InjectionKey, - addPastryUseCase: Symbol('addPastryUseCase') as InjectionKey + addPastryUseCase: Symbol('addPastryUseCase') as InjectionKey, + updatePastryUseCase: Symbol('updatePastryUseCase') as InjectionKey } const appContainerDefinition: ContainerDefinition = { @@ -30,6 +32,9 @@ const appContainerDefinition: ContainerDefinition = { }, addPastryUseCase({ remoteUseCaseProxy }) { return new AddPastryUseCase(remoteUseCaseProxy) + }, + updatePastryUseCase({ remoteUseCaseProxy }) { + return new UpdatePastryUseCase(remoteUseCaseProxy) } } diff --git a/frontend/src/pages/pastries/PastriesListPage.vue b/frontend/src/pages/pastries/PastriesListPage.vue index 959284d..6cb260f 100644 --- a/frontend/src/pages/pastries/PastriesListPage.vue +++ b/frontend/src/pages/pastries/PastriesListPage.vue @@ -1,6 +1,6 @@ diff --git a/frontend/src/pages/pastries/PastriesListView.vue b/frontend/src/pages/pastries/PastriesListView.vue index aeb1e3a..4bf9bc4 100644 --- a/frontend/src/pages/pastries/PastriesListView.vue +++ b/frontend/src/pages/pastries/PastriesListView.vue @@ -1,26 +1,30 @@