예제 #1
0
        public async Task <IActionResult> Post([FromBody] SharedListRequestData requestData)
        {
            var list = await _domainService.ExecuteAsync(new CreateSharedList(User.GetUserId(),
                                                                              requestData.Name, requestData.Tags));

            return(CreatedAtAction(nameof(Get), new { id = list.Id }, list));
        }
예제 #2
0
        public async Task <IActionResult> Patch(int id, [FromBody] SharedListRequestData requestData)
        {
            var list = await _domainService.ExecuteAsync(
                new UpdateSharedList(User.GetUserId(), id, requestData.Name, requestData.Tags,
                                     requestData.Moderators));

            return(Ok(list));
        }