feat(photo/client|sever): fetch photo on upload

This commit is contained in:
Christopher committed 2021-02-07 04:14:00 +01:00
1 parent 6fc469c4a3
commit 1e771e87af
2 files changed
+12 -2

No files matched your search

+4
View File
@@ -127,6 +127,10 @@ function takePhoto() {
);
}
onNet(events.CAMERA_UPLOAD_PHOTO_SUCCESS, () => {
emitNet(events.CAMERA_FETCH_PHOTOS);
})
// delete photo
RegisterNuiCallbackType(events.CAMERA_DELETE_PHOTO);
+8 -2
View File
@@ -26,8 +26,14 @@ async function deletePhoto(photo: IPhoto, identifier: string) {
}
onNet(events.CAMERA_UPLOAD_PHOTO, async (image: string) => {
const identifier = await useIdentifier();
await uploadPhoto(identifier, image);
try {
const pSource = (global as any).source;
const identifier = await useIdentifier();
await uploadPhoto(identifier, image);
emitNet(events.CAMERA_UPLOAD_PHOTO_SUCCESS, pSource);
} catch (error) {
console.dir(error)
}
});
onNet(events.CAMERA_FETCH_PHOTOS, async () => {