Fix implémentations de UploadDocument et models.NotFoundResponse()
This commit is contained in:
parent
37eb18cfa5
commit
48a8c8a37a
4 changed files with 17 additions and 16 deletions
|
@ -130,7 +130,7 @@ func HandleFormulaires(c echo.Context) error {
|
|||
func HandlePublicDocumentation(c echo.Context) error {
|
||||
client, err := api.NewApiClientFromViper()
|
||||
if err != nil {
|
||||
return c.JSON(http.StatusNotFound, models.NotFoundResponse())
|
||||
return c.JSON(models.NotFoundResponse())
|
||||
}
|
||||
|
||||
bucket := c.Param("bucket")
|
||||
|
@ -138,7 +138,7 @@ func HandlePublicDocumentation(c echo.Context) error {
|
|||
|
||||
result, err := client.Call(http.MethodGet, fmt.Sprintf("/v1/bucket/%s/%s", bucket, document))
|
||||
if err != nil {
|
||||
return c.JSON(http.StatusNotFound, models.NotFoundResponse())
|
||||
return c.JSON(models.NotFoundResponse())
|
||||
}
|
||||
|
||||
// Check if result can fit inside a map containing a message
|
||||
|
@ -259,7 +259,7 @@ func HandleAdminDocumentsUploadPOST(c echo.Context) error {
|
|||
// Format response
|
||||
var info, status string
|
||||
|
||||
info = fmt.Sprintf("[%.0f] /public/documentation/%s/%s", uploadDocumentResponse.Data.Size, uploadDocumentResponse.Data.Bucket, uploadDocumentResponse.Data.Object)
|
||||
info = fmt.Sprintf("[%d] /public/documentation/%s/%s", uploadDocumentResponse.Data.Size, uploadDocumentResponse.Data.Bucket, uploadDocumentResponse.Data.Key)
|
||||
|
||||
status = uploadDocumentResponse.Message
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue