mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
fix(camera): resolve issue for deleting images
This commit is contained in:
1 parent
ee7e544b23
commit
1c81bfa7f2
3 files changed
+11
-7
No files matched your search
@@ -16,7 +16,7 @@ InjectDebugData([
|
|||||||
image: 'https://i.imgur.com/OO8wx6Z.jpg',
|
image: 'https://i.imgur.com/OO8wx6Z.jpg',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 2,
|
||||||
image: 'https://i.imgur.com/pqGBiST.jpg',
|
image: 'https://i.imgur.com/pqGBiST.jpg',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -27,12 +27,12 @@ export const GalleryModal = () => {
|
|||||||
history.push(referal);
|
history.push(referal);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDeletePhoto = useCallback(() => {
|
const handleDeletePhoto = () => {
|
||||||
Nui.send('photo:deletePhoto', {
|
Nui.send('photo:deletePhoto', {
|
||||||
id: meta.id,
|
image: meta.image,
|
||||||
});
|
});
|
||||||
history.push(referal);
|
history.push(referal);
|
||||||
}, [history, meta.id, referal]);
|
};
|
||||||
|
|
||||||
const handleSharePhoto = useCallback(() => {
|
const handleSharePhoto = useCallback(() => {
|
||||||
setShareOpen(meta);
|
setShareOpen(meta);
|
||||||
@@ -42,7 +42,11 @@ export const GalleryModal = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ShareModal referal={referal} meta={shareOpen} onClose={() => setShareOpen(null)} />
|
<ShareModal
|
||||||
|
referal={referal}
|
||||||
|
meta={shareOpen}
|
||||||
|
onClose={() => setShareOpen(null)}
|
||||||
|
/>
|
||||||
<Paper className={classes.modal}>
|
<Paper className={classes.modal}>
|
||||||
<div className={shareOpen ? classes.backgroundModal : null} />
|
<div className={shareOpen ? classes.backgroundModal : null} />
|
||||||
<Button onClick={_handleClose}>
|
<Button onClick={_handleClose}>
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ async function getPhotosByIdentifier(identifier: string): Promise<IPhoto[]> {
|
|||||||
|
|
||||||
async function deletePhoto(photo: IPhoto, identifier: string) {
|
async function deletePhoto(photo: IPhoto, identifier: string) {
|
||||||
const query =
|
const query =
|
||||||
'DELETE FROM npwd_phone_gallery WHERE id = ? AND identifier = ?';
|
'DELETE FROM npwd_phone_gallery WHERE image = ? AND identifier = ?';
|
||||||
await pool.query(query, [photo.id, identifier]);
|
await pool.query(query, [photo.image, identifier]);
|
||||||
}
|
}
|
||||||
|
|
||||||
onNet(events.CAMERA_UPLOAD_PHOTO, async (image: string) => {
|
onNet(events.CAMERA_UPLOAD_PHOTO, async (image: string) => {
|
||||||
|
|||||||
Reference in new issue
Block a user