public async Task <ActionResult <GroupPlaylistRatingDownloadModel> > EditGroupPlaylistRatingAsync( GroupPlaylistRatingUploadModel groupPlaylistRatingUploadModel) { try { if (await IsUserValidAsync()) { var groupPlaylistRating = await GroupPlaylistRatingModel.EditGroupPlaylistRatingAsync( groupPlaylistRatingUploadModel.GroupPlaylistRatingId, groupPlaylistRatingUploadModel, ExtractUserIdFromToken(), RepositoryManager); return(Ok(MapEntityToDownloadModel <GroupPlaylistRating, GroupPlaylistRatingDownloadModel>(groupPlaylistRating))); } else { return(Unauthorized()); } } catch (UserForbiddenException) { return(Forbid()); } catch (InvalidTokenException err) { return(BadRequest(new InvalidTokenException(err.InvalidTokenType, err.ErrorMessage))); } catch (Exception err) { LogException(err); return(Problem()); } }
public async Task <ActionResult <GroupPlaylistRatingDownloadModel> > DeleteGroupPlaylistAsync(Guid groupPlaylistRatingId) { try { if (await IsUserValidAsync()) { await GroupPlaylistRatingModel.DeleteGroupPlaylistRatingAsync( groupPlaylistRatingId, ExtractUserIdFromToken(), RepositoryManager); return(Ok()); } else { return(Unauthorized()); } } catch (UserForbiddenException) { return(Forbid()); } catch (InvalidTokenException err) { return(BadRequest(new InvalidTokenException(err.InvalidTokenType, err.ErrorMessage))); } catch (Exception err) { LogException(err); return(Problem()); } }