diff --git a/server/handlers/admin.go b/server/handlers/admin.go index 6807e6e..8f12aa0 100644 --- a/server/handlers/admin.go +++ b/server/handlers/admin.go @@ -71,14 +71,18 @@ func (a *Admin) AddMocks(c echo.Context) error { } } + IDs := make([]string, 0, len(mocks)) for _, mock := range mocks { - if _, err := a.mocksServices.AddMock(sessionID, mock); err != nil { + newMock, err := a.mocksServices.AddMock(sessionID, mock) + if err != nil { return echo.NewHTTPError(http.StatusNotFound, err.Error()) } + IDs = append(IDs, newMock.State.ID) } return c.JSON(http.StatusOK, echo.Map{ "message": "Mocks registered successfully", + "ids": IDs, }) }