예제 #1
0
        public async Task <ObjectResponse> UpdateWidgetAsync(string id, UpdateWidgetDto input)
        {
            ObjectResponse reponse = new ObjectResponse();

            try
            {
                var widget = await _widgetRepository.GetAsync(id);

                widget.Name            = input.Name;
                widget.Owner           = input.Owner;
                widget.Logo            = input.Logo;
                widget.WelcomeMessage  = input.WelcomeMessage;
                widget.TeamIntro       = input.TeamIntro;
                widget.PrimaryColor    = input.PrimaryColor;
                widget.BackgroundColor = input.BackgroundColor;
                widget.ObjectConfigs   = input.ObjectConfigs;

                await _widgetRepository.UpdateAsync(widget);

                reponse.message = "OK";
                return(reponse);
            }
            catch (Exception ex)
            {
                var er = ex.Message;
                reponse.error.Add(er);
                return(reponse);
            }
        }