Update API Documentation for Tender ID Parameter Location
- Changed the parameter location for `tender_id` from "query" to "path" in the API documentation across multiple files, including Swagger JSON, YAML, and Go documentation. - Updated the handler method to retrieve `tender_id` from the path instead of the query parameters, ensuring consistency with the updated API structure. - This change enhances the clarity of the API documentation and aligns with Clean Architecture principles by accurately reflecting the intended usage of the `tender_id` parameter.
This commit is contained in:
@@ -6057,7 +6057,7 @@ const docTemplate = `{
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Tender ID",
|
"description": "Tender ID",
|
||||||
"name": "tender_id",
|
"name": "tender_id",
|
||||||
"in": "query",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -6051,7 +6051,7 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Tender ID",
|
"description": "Tender ID",
|
||||||
"name": "tender_id",
|
"name": "tender_id",
|
||||||
"in": "query",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -5123,7 +5123,7 @@ paths:
|
|||||||
company combination
|
company combination
|
||||||
parameters:
|
parameters:
|
||||||
- description: Tender ID
|
- description: Tender ID
|
||||||
in: query
|
in: path
|
||||||
name: tender_id
|
name: tender_id
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ func (h *Handler) GetPublicTenderApproval(c echo.Context) error {
|
|||||||
// @Tags TenderApprovals
|
// @Tags TenderApprovals
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param tender_id query string true "Tender ID"
|
// @Param tender_id path string true "Tender ID"
|
||||||
// @Success 200 {object} response.APIResponse{data=TenderApprovalResponse} "Tender approval retrieved successfully"
|
// @Success 200 {object} response.APIResponse{data=TenderApprovalResponse} "Tender approval retrieved successfully"
|
||||||
// @Failure 400 {object} response.APIResponse "Bad request - Invalid tender ID or company ID"
|
// @Failure 400 {object} response.APIResponse "Bad request - Invalid tender ID or company ID"
|
||||||
// @Failure 404 {object} response.APIResponse "Not found - Tender approval not found"
|
// @Failure 404 {object} response.APIResponse "Not found - Tender approval not found"
|
||||||
@@ -101,15 +101,15 @@ func (h *Handler) GetPublicTenderApproval(c echo.Context) error {
|
|||||||
// @Security BearerAuth
|
// @Security BearerAuth
|
||||||
// @Router /api/v1/tender-approvals/tender/{tender_id} [get]
|
// @Router /api/v1/tender-approvals/tender/{tender_id} [get]
|
||||||
func (h *Handler) GetTenderApprovalByTenderAndCompany(c echo.Context) error {
|
func (h *Handler) GetTenderApprovalByTenderAndCompany(c echo.Context) error {
|
||||||
tenderID := c.QueryParam("tender_id")
|
|
||||||
companyID := c.Get("company_id").(string)
|
companyID := c.Get("company_id").(string)
|
||||||
|
|
||||||
if companyID == "" {
|
if companyID == "" {
|
||||||
return response.Unauthorized(c, "Unauthorized")
|
return response.Unauthorized(c, "Unauthorized")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tenderID := c.Param("tender_id")
|
||||||
if tenderID == "" {
|
if tenderID == "" {
|
||||||
return response.BadRequest(c, "Missing required parameters", "tender_id and company_id are required")
|
return response.BadRequest(c, "Missing required parameters", "tender_id required")
|
||||||
}
|
}
|
||||||
|
|
||||||
tenderApprovalWithTender, err := h.service.GetTenderApprovalByTenderAndCompanyWithTender(c.Request().Context(), tenderID, companyID)
|
tenderApprovalWithTender, err := h.service.GetTenderApprovalByTenderAndCompanyWithTender(c.Request().Context(), tenderID, companyID)
|
||||||
|
|||||||
Reference in New Issue
Block a user