(handler func(echo.Context, *storage.ReturnJob) error)
| 421 | } |
| 422 | |
| 423 | func jobResolver(handler func(echo.Context, *storage.ReturnJob) error) func(c echo.Context) error { |
| 424 | return func(c echo.Context) error { |
| 425 | id := c.Param("id") |
| 426 | job, ok := storage.Jobs.GetById(id) |
| 427 | if !ok { |
| 428 | return c.NoContent(404) |
| 429 | } |
| 430 | return handler(c, job) |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | func getLastJob(c echo.Context) error { |
| 435 | if err := storage.Jobs.TakeLastJob(c.Response()); errors.Is(err, storage.ErrNotFound) { |