File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -275,6 +275,12 @@ func (app *application) DeletePayroll(c echo.Context) error {
275275
276276func (app * application ) updatePayrollHandler (c echo.Context ) error {
277277
278+ id := c .Param ("id" )
279+ payroll_id , err := uuid .Parse (id )
280+ if err != nil {
281+ return c .JSON (http .StatusBadRequest , map [string ]string {"error" : "invalid uuid" })
282+ }
283+
278284 var input struct {
279285 BasicSalary * float64 `json:"basic_salary"`
280286 TIN * string `json:"tin"`
@@ -291,7 +297,7 @@ func (app *application) updatePayrollHandler(c echo.Context) error {
291297 return c .JSON (http .StatusBadRequest , map [string ]string {"error" : err .Error ()})
292298 }
293299
294- e , err := app .store .JustGetPayroll (c .Request ().Context ())
300+ e , err := app .store .GetPayrollByID (c .Request ().Context (), payroll_id )
295301
296302 if err != nil {
297303 slog .Error ("Error Getting employee for update " , "Error" , err .Error ())
You can’t perform that action at this time.
0 commit comments