Moving Avatars into ORM

This commit is contained in:
stephb9959
2021-12-27 23:50:38 -08:00
parent 81131b8038
commit c078bdb555
4 changed files with 28 additions and 10 deletions

View File

@@ -62,13 +62,13 @@ namespace OpenWifi {
if (Id.empty()) {
return NotFound();
}
Poco::TemporaryFile TempAvatar;
std::string Type, Name;
if (!StorageService()->AvatarDB().GetAvatar(UserInfo_.userinfo.email, Id, TempAvatar, Type, Name)) {
std::string Type, Name, AvatarContent;
if (!StorageService()->AvatarDB().GetAvatar(UserInfo_.userinfo.email, Id, AvatarContent, Type, Name)) {
return NotFound();
}
std::cout << "Sending avatar" << std::endl;
SendFile(TempAvatar, Type, Name);
SendFileContent(AvatarContent, Type, Name);
}
void RESTAPI_avatar_handler::DoDelete() {