stock request table created
This commit is contained in:
@@ -252,6 +252,40 @@ func (ctl *TenantController) CreateLocation(c *fiber.Ctx) error {
|
||||
})
|
||||
}
|
||||
|
||||
func (ctl *TenantController) DeleteLocation(c *fiber.Ctx) error {
|
||||
locationid, err := strconv.Atoi(c.Query("locationid"))
|
||||
if err != nil {
|
||||
return c.Status(http.StatusBadRequest).JSON(fiber.Map{
|
||||
"code": http.StatusBadRequest,
|
||||
"message": "Invalid location ID",
|
||||
"status": false,
|
||||
})
|
||||
}
|
||||
|
||||
tenantid, err := strconv.Atoi(c.Query("tenantid"))
|
||||
if err != nil {
|
||||
return c.Status(http.StatusBadRequest).JSON(fiber.Map{
|
||||
"code": http.StatusBadRequest,
|
||||
"message": "Invalid tenant ID",
|
||||
"status": false,
|
||||
})
|
||||
}
|
||||
|
||||
if err := ctl.tenantService.DeleteLocation(locationid, tenantid); err != nil {
|
||||
return c.Status(http.StatusInternalServerError).JSON(fiber.Map{
|
||||
"code": http.StatusInternalServerError,
|
||||
"message": err.Error(),
|
||||
"status": false,
|
||||
})
|
||||
}
|
||||
|
||||
return c.JSON(fiber.Map{
|
||||
"code": http.StatusOK,
|
||||
"message": "Location Successfully Deleted",
|
||||
"status": true,
|
||||
})
|
||||
}
|
||||
|
||||
func (ctl *TenantController) GetStaffs(c *fiber.Ctx) error {
|
||||
tid, _ := strconv.Atoi(c.Query("tenantid"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user