This commit is contained in:
Adria Navarro 2025-01-27 16:00:44 +01:00
parent 8842bfe3b4
commit 3f10a3404c
1 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ import {
navigationStore, navigationStore,
selectedComponent, selectedComponent,
} from "@/stores/builder" } from "@/stores/builder"
import { createHistoryStore } from "@/stores/builder/history" import { createHistoryStore, HistoryStore } from "@/stores/builder/history"
import { API } from "@/api" import { API } from "@/api"
import { BudiStore } from "../BudiStore" import { BudiStore } from "../BudiStore"
import { import {
@ -33,8 +33,8 @@ export const initialScreenState: ScreenState = {
// Review the nulls // Review the nulls
export class ScreenStore extends BudiStore<ScreenState> { export class ScreenStore extends BudiStore<ScreenState> {
history: any history: HistoryStore<Screen>
delete: any delete: (screens: Screen) => Promise<void>
save: (screen: Screen) => Promise<Screen> save: (screen: Screen) => Promise<Screen>
constructor() { constructor() {
@ -365,10 +365,10 @@ export class ScreenStore extends BudiStore<ScreenState> {
* Any deleted screens will then have their routes/links purged * Any deleted screens will then have their routes/links purged
* *
* Wrapped by {@link delete} * Wrapped by {@link delete}
* @param {Screen | Screen[]} screens * @param {Screen } screens
*/ */
async deleteScreen(screens: Screen | Screen[]) { async deleteScreen(screen: Screen) {
const screensToDelete = Array.isArray(screens) ? screens : [screens] const screensToDelete = [screen]
// Build array of promises to speed up bulk deletions // Build array of promises to speed up bulk deletions
let promises: Promise<DeleteScreenResponse>[] = [] let promises: Promise<DeleteScreenResponse>[] = []
let deleteUrls: string[] = [] let deleteUrls: string[] = []