예제 #1
0
        public async Task <IActionResult> Create(PostitDtoIn postit)
        {
            if (postit.Whiteboard == null)
            {
                return(BadRequest("A whiteboard must be provided to add a note to"));
            }
            var note = _mapper.Map <Postit>(postit);

            await _postitService.Create(note);

            return(CreatedAtAction(nameof(GetById), new { id = postit.Id }, postit));
        }
예제 #2
0
        public async Task <IActionResult> Update(PostitDtoIn postit)
        {
            if (postit.Whiteboard == null)
            {
                return(BadRequest("Whiteboard must be given"));
            }

            var note = _mapper.Map <Postit>(postit);
            await _postitService.Update(note);

            return(Ok());
        }