File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
LibraryManagement.Api/Controllers Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -104,5 +104,38 @@ public async ValueTask<ActionResult<Reader>> GetReaderByIdAsync(Guid readerId)
104104 return InternalServerError ( readerServiceException . InnerException ) ;
105105 }
106106 }
107+
108+ [ HttpPut ]
109+ public async ValueTask < ActionResult < Reader > > PutReaderAsync ( Reader reader )
110+ {
111+ try
112+ {
113+ Reader modifyReader =
114+ await this . readerService . ModifyReaderAsync ( reader ) ;
115+
116+ return Ok ( modifyReader ) ;
117+ }
118+ catch ( ReaderValidationException readerValidationException )
119+ when ( readerValidationException . InnerException is NotFoundReaderException )
120+ {
121+ return NotFound ( readerValidationException . InnerException ) ;
122+ }
123+ catch ( ReaderValidationException readerValidationException )
124+ {
125+ return BadRequest ( readerValidationException . InnerException ) ;
126+ }
127+ catch ( ReaderDependencyValidationException readerDependencyValidationException )
128+ {
129+ return Conflict ( readerDependencyValidationException . InnerException ) ;
130+ }
131+ catch ( ReaderDependencyException readerDependencyException )
132+ {
133+ return InternalServerError ( readerDependencyException . InnerException ) ;
134+ }
135+ catch ( ReaderServiceException readerServiceException )
136+ {
137+ return InternalServerError ( readerServiceException . InnerException ) ;
138+ }
139+ }
107140 }
108141}
You can’t perform that action at this time.
0 commit comments