api to ts
This commit is contained in:
parent
96cee21792
commit
f938eb3297
|
@ -1,6 +1,10 @@
|
|||
import { createAPIClient } from "@budibase/frontend-core"
|
||||
import { authStore } from "../stores/auth.js"
|
||||
import { notificationStore, devToolsEnabled, devToolsStore } from "../stores/"
|
||||
import {
|
||||
notificationStore,
|
||||
devToolsEnabled,
|
||||
devToolsStore,
|
||||
} from "../stores/index.js"
|
||||
import { get } from "svelte/store"
|
||||
|
||||
export const API = createAPIClient({
|
|
@ -1,4 +1,4 @@
|
|||
import { API } from "./api.js"
|
||||
import { API } from "./api.ts"
|
||||
import { patchAPI } from "./patches.js"
|
||||
|
||||
// Certain endpoints which return rows need patched so that they transform
|
||||
|
|
|
@ -18,7 +18,7 @@ const createNotificationStore = () => {
|
|||
type = "info",
|
||||
icon: string,
|
||||
autoDismiss = true,
|
||||
duration: number,
|
||||
duration?: number,
|
||||
count = 1
|
||||
) => {
|
||||
if (block) {
|
||||
|
@ -77,13 +77,13 @@ const createNotificationStore = () => {
|
|||
subscribe: store.subscribe,
|
||||
actions: {
|
||||
send,
|
||||
info: (msg: string, autoDismiss: boolean, duration: number) =>
|
||||
info: (msg: string, autoDismiss?: boolean, duration?: number) =>
|
||||
send(msg, "info", "Info", autoDismiss ?? true, duration),
|
||||
success: (msg: string, autoDismiss: boolean, duration: number) =>
|
||||
success: (msg: string, autoDismiss?: boolean, duration?: number) =>
|
||||
send(msg, "success", "CheckmarkCircle", autoDismiss ?? true, duration),
|
||||
warning: (msg: string, autoDismiss: boolean, duration: number) =>
|
||||
warning: (msg: string, autoDismiss?: boolean, duration?: number) =>
|
||||
send(msg, "warning", "Alert", autoDismiss ?? true, duration),
|
||||
error: (msg: string, autoDismiss: boolean, duration: number) =>
|
||||
error: (msg: string, autoDismiss?: boolean, duration?: number) =>
|
||||
send(msg, "error", "Alert", autoDismiss ?? false, duration),
|
||||
blockNotifications,
|
||||
dismiss,
|
||||
|
|
Loading…
Reference in New Issue