no empty document error for client
This commit is contained in:
@@ -401,7 +401,7 @@ func (h *TenderHandler) GetDocumentSummaries(c echo.Context) error {
|
||||
// @Param id path string true "Tender ID"
|
||||
// @Success 200 {object} response.APIResponse{data=TenderDocumentsResponse}
|
||||
// @Failure 400 {object} response.APIResponse
|
||||
// @Failure 404 {object} response.APIResponse
|
||||
// @Failure 404 {object} response.APIResponse "Tender not found"
|
||||
// @Failure 500 {object} response.APIResponse
|
||||
// @Router /api/v1/tenders/{id}/documents [get]
|
||||
func (h *TenderHandler) GetDocuments(c echo.Context) error {
|
||||
@@ -412,7 +412,10 @@ func (h *TenderHandler) GetDocuments(c echo.Context) error {
|
||||
|
||||
documents, err := h.service.GetDocuments(c.Request().Context(), id)
|
||||
if err != nil {
|
||||
return response.NotFound(c, "Tender documents not found")
|
||||
if errors.Is(err, orm.ErrDocumentNotFound) {
|
||||
return response.NotFound(c, "Tender not found")
|
||||
}
|
||||
return response.InternalServerError(c, "Failed to retrieve tender documents")
|
||||
}
|
||||
|
||||
return response.Success(c, documents, "Tender documents retrieved successfully")
|
||||
|
||||
Reference in New Issue
Block a user