u
This commit is contained in:
1 parent
25a9e41025
commit
5308dc8fda
8 files changed
+209
-25
No files matched your search
@@ -52,3 +52,26 @@ func QueryUserMoneyCategory(ctx context.Context, c *app.RequestContext) {
|
||||
|
||||
response.Success(c).Data(resp).Send()
|
||||
}
|
||||
|
||||
// DeleteUserMoneyCategory .
|
||||
// @router /money/category/delete [GET]
|
||||
func DeleteUserMoneyCategory(ctx context.Context, c *app.RequestContext) {
|
||||
var err error
|
||||
var req money_category.DeleteUserMoneyCategoryReq
|
||||
err = c.BindAndValidate(&req)
|
||||
if err != nil {
|
||||
c.String(consts.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
err = db.Queries.DeleteUserMoneyCategoryById(ctx, req.Id)
|
||||
|
||||
if err != nil {
|
||||
errorx.AddError(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
resp := new(money_category.DeleteUserMoneyCategoryResp)
|
||||
|
||||
response.Success(c).Data(resp).Send()
|
||||
}
|
||||
Reference in new issue
Block a user