Fix escaped ' in JSON
This commit is contained in:
parent
9b96295691
commit
20f34e91e2
@ -74,8 +74,8 @@ export const fetchGallery = async (galleryID: string): Promise<Gallery> => {
|
|||||||
if (!postDataMatches || postDataMatches.length < 2) {
|
if (!postDataMatches || postDataMatches.length < 2) {
|
||||||
throw new Error('Could not parse gallery data');
|
throw new Error('Could not parse gallery data');
|
||||||
}
|
}
|
||||||
const postData = JSON.parse(JSON.parse(postDataMatches[1]));
|
const body = postDataMatches[1].replace(/\\'/g, "'");
|
||||||
return postData;
|
return JSON.parse(JSON.parse(body));
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchMedia = async (filename: string): Promise<Response<string>> =>
|
export const fetchMedia = async (filename: string): Promise<Response<string>> =>
|
||||||
|
@ -33,7 +33,6 @@ export const handleAlbum = async (request: Hapi.Request, h: Hapi.ResponseToolkit
|
|||||||
pageTitle: CONFIG.page_title,
|
pageTitle: CONFIG.page_title,
|
||||||
util,
|
util,
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const handleUser = (request: Hapi.Request, h: Hapi.ResponseToolkit) => {
|
export const handleUser = (request: Hapi.Request, h: Hapi.ResponseToolkit) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user