MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / UpdateApp

Method UpdateApp

module/service/iml.go:1248–1269  ·  view source on GitHub ↗
(ctx context.Context, appId string, input *service_dto.UpdateApp)

Source from the content-addressed store, hash-verified

1246}
1247
1248func (i *imlAppModule) UpdateApp(ctx context.Context, appId string, input *service_dto.UpdateApp) (*service_dto.App, error) {
1249 // userId := utils.UserId(ctx)
1250 info, err := i.serviceService.Get(ctx, appId)
1251 if err != nil {
1252 return nil, err
1253 }
1254 if !info.AsApp {
1255 return nil, fmt.Errorf("not app")
1256 }
1257 //if info.Master != userId {
1258 // return nil, fmt.Errorf("user is not app master, can not update")
1259 //}
1260
1261 err = i.serviceService.Save(ctx, appId, &service.Edit{
1262 Name: input.Name,
1263 Description: input.Description,
1264 })
1265 if err != nil {
1266 return nil, err
1267 }
1268 return i.GetApp(ctx, info.Id)
1269}
1270
1271func (i *imlAppModule) searchMyApps(ctx context.Context, teamId string, keyword string) ([]*service.Service, error) {
1272 userID := utils.UserId(ctx)

Callers

nothing calls this directly

Calls 3

GetAppMethod · 0.95
GetMethod · 0.65
SaveMethod · 0.65

Tested by

no test coverage detected