Figured out how to check if Int32 values from the ObjectWrapper have any values. Just get the pointer of it and see if it is a nullptr

This commit is contained in:
kdeng00
2019-09-12 21:59:29 -04:00
parent 0a97f695e3
commit 2fdc86e0b3
2 changed files with 36 additions and 18 deletions
+2 -1
View File
@@ -155,12 +155,13 @@ namespace controller
// TODO: create endpoint for updating songs
ENDPOINT("UPDATE", "/api/v1/song/{id}", songUpdate,
BODY_DTO(dto::SongDto::ObjectWrapper, songDto), PATH(Int32, id)) {
model::Song song(id);
songDto->id = id;
auto updatedSong = manager::SongManager::songDtoConv(songDto);
std::cout << "printing updated song" << std::endl;
manager::SongManager::printSong(updatedSong);
manager::SongManager songMgr(m_bConf);
songMgr.updateSong(updatedSong);
return createResponse(Status::CODE_200, "OK");
}