Attempt to fix flakey 409s when deleting screens that are linked in the nav (#9700)
This commit is contained in:
parent
c5bc0d4ffb
commit
c81ef6f128
|
@ -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 => {
|
||||||
|
|
Loading…
Reference in New Issue