// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. //go:build plus package scripts import ( "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" "github.com/TeaOSLab/EdgeCommon/pkg/langs/codes" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" ) type DeleteAction struct { actionutils.ParentAction } func (this *DeleteAction) RunPost(params struct { ScriptId int64 }) { defer this.CreateLogInfo(codes.Script_LogDeleteScript, params.ScriptId) _, err := this.RPC().ScriptRPC().DeleteScript(this.AdminContext(), &pb.DeleteScriptRequest{ScriptId: params.ScriptId}) if err != nil { this.ErrorPage(err) return } this.Success() }