| 1246 | } |
| 1247 | |
| 1248 | func (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 | |
| 1271 | func (i *imlAppModule) searchMyApps(ctx context.Context, teamId string, keyword string) ([]*service.Service, error) { |
| 1272 | userID := utils.UserId(ctx) |