Ajouter et implémenter models.NotImplementedResponse() #139

Merged
vlbeaudoin merged 1 commit from refactor/not-implemented-response into main 2023-08-23 15:44:07 -04:00
2 changed files with 10 additions and 3 deletions

View file

@ -258,6 +258,7 @@ func HandleV1DocumentCreate(c echo.Context) error {
response.Data.Bucket = info.Bucket
response.Data.Key = info.Key
response.Data.Size = info.Size
return c.JSON(response.StatusCode, response)
}
@ -334,9 +335,7 @@ func HandleV1DocumentRead(c echo.Context) error {
// HandleV1DocumentUpdate permet de mettre à jour certains champs d'un object, comme le Content-Type ou le Filename
func HandleV1DocumentUpdate(c echo.Context) error {
return c.JSON(http.StatusNotImplemented, map[string]string{
"message": "Not Implemented",
})
return c.JSON(models.NotImplementedResponse())
}
// HandleV1DocumentDelete permet de supprimer un object

View file

@ -1,5 +1,7 @@
package models
import "net/http"
type Responder interface {
Respond() Responder
}
@ -28,6 +30,12 @@ func NotFoundResponse() SimpleResponse {
}
}
func NotImplementedResponse() (int, SimpleResponse) {
return http.StatusNotImplemented, SimpleResponse{
Message: "Not Implemented",
}
}
type HandleAdminDocumentsUploadResponse struct {
Response
Data struct {