Attempt to fix flakey 409s when deleting screens that are linked in the nav (#9700)

This commit is contained in:
Andrew Kingston 2023-02-16 13:33:53 +00:00 committed by GitHub
parent c5bc0d4ffb
commit c81ef6f128
1 changed files with 2 additions and 2 deletions

View File

@ -312,7 +312,7 @@ export const getFrontendStore = () => {
const screensToDelete = Array.isArray(screens) ? screens : [screens] const screensToDelete = Array.isArray(screens) ? screens : [screens]
// Build array of promises to speed up bulk deletions // Build array of promises to speed up bulk deletions
const promises = [] let promises = []
let deleteUrls = [] let deleteUrls = []
screensToDelete.forEach(screen => { screensToDelete.forEach(screen => {
// Delete the screen // Delete the screen
@ -326,8 +326,8 @@ export const getFrontendStore = () => {
deleteUrls.push(screen.routing.route) deleteUrls.push(screen.routing.route)
}) })
promises.push(store.actions.links.delete(deleteUrls))
await Promise.all(promises) await Promise.all(promises)
await store.actions.links.delete(deleteUrls)
const deletedIds = screensToDelete.map(screen => screen._id) const deletedIds = screensToDelete.map(screen => screen._id)
const routesResponse = await API.fetchAppRoutes() const routesResponse = await API.fetchAppRoutes()
store.update(state => { store.update(state => {