Extract APIs to their own files #108

Merged
bustikiller merged 8 commits from extract-apis into main 2024-11-17 17:02:08 +00:00
3 changed files with 3 additions and 3 deletions
Showing only changes of commit c1d199f08d - Show all commits

View File

@ -3,7 +3,7 @@
import { Group } from '@/app/lib/definitions';
export function loadGroups(onLoad?: (groups: Group[]) => void) {
fetch("/api/groups.json")
fetch("/api/groups")
.then((response) => response.json())
.then((data) => {
onLoad && onLoad(data.map((record: any) => {

View File

@ -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.json")
fetch("/api/guests")
.then((response) => response.json())
.then((data) => {
onLoad && onLoad(data.map((record: any) => {

View File

@ -1,7 +1,7 @@
import { test, expect, Page } from '@playwright/test'
const mockGuestsAPI = ({ page }: { page: Page }) => {
page.route('*/**/api/guests.json', async route => {
page.route('*/**/api/guests', async route => {
const json = [
{
"id": "f4a09c28-40ea-4553-90a5-96935a59cac6",