Fix escaped ' in JSON

This commit is contained in:
3nprob 2021-10-08 02:21:04 +09:00
parent 9b96295691
commit 20f34e91e2
2 changed files with 2 additions and 3 deletions

View File

@ -74,8 +74,8 @@ export const fetchGallery = async (galleryID: string): Promise<Gallery> => {
if (!postDataMatches || postDataMatches.length < 2) {
throw new Error('Could not parse gallery data');
}
const postData = JSON.parse(JSON.parse(postDataMatches[1]));
return postData;
const body = postDataMatches[1].replace(/\\'/g, "'");
return JSON.parse(JSON.parse(body));
};
export const fetchMedia = async (filename: string): Promise<Response<string>> =>

View File

@ -33,7 +33,6 @@ export const handleAlbum = async (request: Hapi.Request, h: Hapi.ResponseToolkit
pageTitle: CONFIG.page_title,
util,
});
};
export const handleUser = (request: Hapi.Request, h: Hapi.ResponseToolkit) => {