예제 #1
0
 public Task <int> UpdateCell(
     CellInput input,
     [CurrentUserGlobalState] CurrentUser user,
     [Service] IUserRepository repo
     )
 {
     return(repo.UpdateCell(user.UserId, input));
 }
예제 #2
0
        public async Task <int> UpdateCell(string userId, CellInput input)
        {
            string      jsonOptions = JsonSerializer.Serialize(input.options);
            JsonElement options     = JsonSerializer.Deserialize <JsonElement>(jsonOptions);
            string      jsonInput   = JsonSerializer.Serialize(input.input);
            JsonElement inputQuery  = JsonSerializer.Deserialize <JsonElement>(jsonInput);

            if (input.cellId != null)
            {
                int    id          = input.cellId.GetValueOrDefault();
                string queryString =
                    UserQueryBuilder.UpdateCellQueryString(userId, id, input.dashboardId, options, inputQuery);
                return(await executeQueryString(queryString));
            }
            else
            {
                return(await CreateCell(input.dashboardId, options, inputQuery));
            }
        }