Skip to content

Commit 0ec499f

Browse files
committed
fix: update name and data
1 parent f60a43a commit 0ec499f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

routers/api/v1/repo/action.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ func (Action) UpdateVariable(ctx *context.APIContext) {
414414
if opt.Name == "" {
415415
opt.Name = ctx.PathParam("variablename")
416416
}
417+
418+
v.Name = opt.Name
419+
v.Data = opt.Value
420+
417421
if _, err := actions_service.UpdateVariable(ctx, v); err != nil {
418422
if errors.Is(err, util.ErrInvalidArgument) {
419423
ctx.Error(http.StatusBadRequest, "UpdateVariable", err)

routers/api/v1/user/action.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ func UpdateVariable(ctx *context.APIContext) {
212212
if opt.Name == "" {
213213
opt.Name = ctx.PathParam("variablename")
214214
}
215+
216+
v.Name = opt.Name
217+
v.Data = opt.Value
218+
215219
if _, err := actions_service.UpdateVariable(ctx, v); err != nil {
216220
if errors.Is(err, util.ErrInvalidArgument) {
217221
ctx.Error(http.StatusBadRequest, "UpdateVariable", err)

0 commit comments

Comments
 (0)