Remove extension from the API's URLs
This commit is contained in:
parent
1fdac88c75
commit
c1d199f08d
@ -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) => {
|
||||||
|
@ -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) => {
|
||||||
|
@ -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",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user