Remove extension from the API's URLs
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 39s
Add copyright notice / copyright_notice (pull_request) Successful in 51s
Playwright Tests / test (pull_request) Successful in 2m47s

This commit is contained in:
Manuel Bustillo 2024-11-17 17:58:08 +01:00
parent 1fdac88c75
commit c1d199f08d
3 changed files with 3 additions and 3 deletions

View File

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

View File

@ -4,7 +4,7 @@ import { Guest } from '@/app/lib/definitions';
import { getCsrfToken } from '@/app/lib/utils'; import { getCsrfToken } from '@/app/lib/utils';
export function loadGuests(onLoad?: (guests: Guest[]) => void) { export function loadGuests(onLoad?: (guests: Guest[]) => void) {
fetch("/api/guests.json") fetch("/api/guests")
.then((response) => response.json()) .then((response) => response.json())
.then((data) => { .then((data) => {
onLoad && onLoad(data.map((record: any) => { onLoad && onLoad(data.map((record: any) => {

View File

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