refactor: Update toast functionality to use Swal

This commit is contained in:
yoosangwook 2024-09-27 15:50:59 +09:00
parent cba28de088
commit 8779444b9b
3 changed files with 22 additions and 2 deletions

View File

@ -0,0 +1,9 @@
'ues client'
import { ErrorBoundary } from 'next/dist/client/components/error-boundary'
import ServerError from '../error'
export const FloorPlanProvider = ({ children }) => {
console.log('FloorPlanProvider')
return <ErrorBoundary fallback={<ServerError />}>{children}</ErrorBoundary>
}

View File

@ -0,0 +1,11 @@
'use client'
import { FloorPlanProvider } from './FloorPlanProvider'
export default function FloorPlanLayout({ children }) {
console.log('FloorPlanLayout')
return (
<>
<FloorPlanProvider>{children}</FloorPlanProvider>
</>
)
}

View File

@ -108,10 +108,10 @@ export default function FirstOption() {
}
// HTTP POST
await post({ url: `/api/canvas-management/canvas-settings`, data: patternData }).then((res) => {\
await post({ url: `/api/canvas-management/canvas-settings`, data: patternData }).then((res) => {
swalFire({ text: getMessage(res.returnMessage) })
})
} catch (error) {\
} catch (error) {
swalFire({ text: getMessage(res.returnMessage) })
}
}