Compare commits
4 Commits
00d1ac7934
...
bb403fd512
Author | SHA1 | Date | |
---|---|---|---|
|
bb403fd512 | ||
15144b478e | |||
3385230353 | |||
54be5515e5 |
@ -4,7 +4,7 @@ import { Expense } from '@/app/lib/definitions';
|
||||
import { getCsrfToken } from '@/app/lib/utils';
|
||||
|
||||
export function loadExpenses(onLoad?: (expenses: Expense[]) => void) {
|
||||
fetch("/api/expenses")
|
||||
fetch("/api/default/expenses")
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
onLoad && onLoad(data.map((record: any) => {
|
||||
@ -21,7 +21,7 @@ export function loadExpenses(onLoad?: (expenses: Expense[]) => void) {
|
||||
}
|
||||
|
||||
export function updateExpense(expense: Expense) {
|
||||
fetch(`/api/expenses/${expense.id}`,
|
||||
fetch(`/api/default/expenses/${expense.id}`,
|
||||
{
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({
|
||||
|
@ -3,7 +3,7 @@
|
||||
import { Group } from '@/app/lib/definitions';
|
||||
|
||||
export function loadGroups(onLoad?: (groups: Group[]) => void) {
|
||||
fetch("/api/groups")
|
||||
fetch("/api/default/groups")
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
onLoad && onLoad(data.map((record: any) => {
|
||||
|
@ -4,7 +4,7 @@ import { Guest } from '@/app/lib/definitions';
|
||||
import { getCsrfToken } from '@/app/lib/utils';
|
||||
|
||||
export function loadGuests(onLoad?: (guests: Guest[]) => void) {
|
||||
fetch("/api/guests")
|
||||
fetch("/api/default/guests")
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
onLoad && onLoad(data.map((record: any) => {
|
||||
@ -22,7 +22,7 @@ export function loadGuests(onLoad?: (guests: Guest[]) => void) {
|
||||
};
|
||||
|
||||
export function updateGuest(guest: Guest) {
|
||||
return fetch(`/api/guests/${guest.id}`,
|
||||
return fetch(`/api/default/guests/${guest.id}`,
|
||||
{
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ guest: { name: guest.name, status: guest.status } }),
|
||||
@ -35,7 +35,7 @@ export function updateGuest(guest: Guest) {
|
||||
}
|
||||
|
||||
export function createGuest(name: string, group_id: string, onCreate?: () => void) {
|
||||
fetch("/api/guests", {
|
||||
fetch("/api/default/guests", {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ name: name, group_id: group_id }),
|
||||
headers: {
|
||||
@ -51,7 +51,7 @@ export function createGuest(name: string, group_id: string, onCreate?: () => voi
|
||||
}
|
||||
|
||||
export function destroyGuest(guest: Guest, onDestroy?: () => void) {
|
||||
fetch(`/api/guests/${guest.id}`, {
|
||||
fetch(`/api/default/guests/${guest.id}`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': getCsrfToken(),
|
||||
|
@ -3,7 +3,7 @@
|
||||
import { TableArrangement } from '@/app/lib/definitions';
|
||||
|
||||
export function loadTableSimulations(onLoad?: (tableSimulations: TableArrangement[]) => void) {
|
||||
fetch('/api/tables_arrangements')
|
||||
fetch('/api/default/tables_arrangements')
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
onLoad && onLoad(data.map((record: any) => {
|
||||
|
@ -33,5 +33,5 @@
|
||||
"engines": {
|
||||
"node": ">=23.0.0"
|
||||
},
|
||||
"packageManager": "pnpm@9.14.2+sha512.6e2baf77d06b9362294152c851c4f278ede37ab1eba3a55fda317a4a17b209f4dbb973fb250a77abc463a341fcb1f17f17cfa24091c4eb319cda0d9b84278387"
|
||||
"packageManager": "pnpm@9.14.4+sha512.c8180b3fbe4e4bca02c94234717896b5529740a6cbadf19fa78254270403ea2f27d4e1d46a08a0f56c89b63dc8ebfd3ee53326da720273794e6200fcf0d184ab"
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { test, expect, Page } from '@playwright/test'
|
||||
|
||||
const mockGuestsAPI = ({ page }: { page: Page }) => {
|
||||
page.route('*/**/api/guests', async route => {
|
||||
page.route('*/**/api/default/guests', async route => {
|
||||
const json = [
|
||||
{
|
||||
"id": "f4a09c28-40ea-4553-90a5-96935a59cac6",
|
||||
@ -28,7 +28,7 @@ const mockGuestsAPI = ({ page }: { page: Page }) => {
|
||||
}
|
||||
|
||||
const mockGroupsAPI = ({ page }: { page: Page }) => {
|
||||
page.route('*/**/api/groups', async route => {
|
||||
page.route('*/**/api/default/groups', async route => {
|
||||
const json = [
|
||||
{
|
||||
"id": "ee44ffb9-1147-4842-a378-9eaeb0f0871a",
|
||||
|
Loading…
x
Reference in New Issue
Block a user