cleanup(photos): A general cleanup of photos

Removes legacy code no longer in use or cleans up code to use new type safe native wrappers
This commit is contained in:
Taso committed 2021-07-27 22:39:18 -04:00
1 parent 83ec915926
commit 16626db5bd
9 files changed
+34 -141

No files matched your search

@@ -1,16 +1,8 @@
import { getSource } from '../utils/miscUtils';
import { GalleryPhoto, PhotoEvents } from '../../../typings/photo';
import PhotoService from './photo.service';
import { photoLogger } from './photo.utils';
import { onNetPromise } from '../utils/PromiseNetEvents/onNetPromise';
/*onNet(PhotoEvents.UPLOAD_PHOTO, async (image: string) => {
const src = getSource();
PhotoService.handleUploadPhoto(src, image).catch((e) =>
photoLogger.error(`Error occurred in upload photo event (${src}), Error: ${e.message}`),
);
});*/
onNetPromise<string, GalleryPhoto>(PhotoEvents.UPLOAD_PHOTO, (reqObj, resp) => {
PhotoService.handleUploadPhoto(reqObj, resp).catch((e) => {
photoLogger.error(
@@ -29,13 +21,6 @@ onNetPromise<void, GalleryPhoto[]>(PhotoEvents.FETCH_PHOTOS, (reqObj, resp) => {
});
});
/*onNet(PhotoEvents.FETCH_PHOTOS, async () => {
const src = getSource();
PhotoService.handleFetchPhotos(src).catch((e) =>
photoLogger.error(`Error occurred in upload photo event (${src}), Error: ${e.message}`),
);
});*/
onNetPromise<GalleryPhoto, void>(PhotoEvents.DELETE_PHOTO, (reqObj, resp) => {
PhotoService.handleDeletePhoto(reqObj, resp).catch((e) => {
photoLogger.error(
@@ -44,10 +29,3 @@ onNetPromise<GalleryPhoto, void>(PhotoEvents.DELETE_PHOTO, (reqObj, resp) => {
resp({ status: 'error', errorMsg: 'INTERNAL_ERROR' });
});
});
/*onNet(PhotoEvents.DELETE_PHOTO, async (photo: GalleryPhoto) => {
const src = getSource();
PhotoService.handleDeletePhoto(src, photo).catch((e) =>
photoLogger.error(`Error occurred in delete photo event (${src}), Error: ${e.message}`),
);
});*/
+1 -1
View File
@@ -1,5 +1,5 @@
import PlayerService from '../players/player.service';
import { GalleryPhoto, PhotoEvents } from '../../../typings/photo';
import { GalleryPhoto } from '../../../typings/photo';
import PhotoDB, { _PhotoDB } from './photo.db';
import { photoLogger } from './photo.utils';
import { PromiseEventResp, PromiseRequest } from '../utils/PromiseNetEvents/promise.types';