Skip to content

Commit 1644099

Browse files
committed
added mock timeout to testing
1 parent 1d4dacc commit 1644099

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

pages/api/insertpagelinks.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ async function handler(req, res) {
1414
await insertPageLinks(req.body);
1515

1616
let updatedLinkData = await getLinkData();
17+
18+
19+
// mock loading times for testing
20+
// await new Promise((resolve, reject) =>
21+
// setTimeout(() => {
22+
// resolve();
23+
// }, 5000)
24+
// );
25+
1726
// console.log(updatedPageData);
1827
res.json({ success: true, updatedLinkData: updatedLinkData.linkData });
1928
} catch (error) {

pages/api/updatepagelinks.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ async function handler(req, res) {
1414

1515
let updatedLinkData = await getLinkData();
1616

17+
// mock loading times for testing
18+
// await new Promise((resolve, reject) =>
19+
// setTimeout(() => {
20+
// resolve();
21+
// }, 5000)
22+
// );
1723
res.json({ success: true, updatedLinkData: updatedLinkData.linkData });
1824
} catch (error) {
1925
console.log(error.message);

0 commit comments

Comments
 (0)