Skip to content

Commit 3107696

Browse files
committed
Migrate Playwright privateApi helper to new client API
1 parent 2565fef commit 3107696

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

frontend/tests/utils/privateApi.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// Note: the `PrivateService` is only available when generating the client
22
// for local environments
3-
import { OpenAPI, PrivateService } from "../../src/client"
3+
import { PrivateService } from "../../src/client"
4+
import { client } from "../../src/client/client.gen"
45

5-
OpenAPI.BASE = `${process.env.VITE_API_URL}`
6+
client.setConfig({
7+
baseURL: `${process.env.VITE_API_URL}`,
8+
})
69

710
export const createUser = async ({
811
email,
@@ -11,12 +14,13 @@ export const createUser = async ({
1114
email: string
1215
password: string
1316
}) => {
14-
return await PrivateService.createUser({
15-
requestBody: {
17+
const response = await PrivateService.createUser({
18+
body: {
1619
email,
1720
password,
1821
is_verified: true,
1922
full_name: "Test User",
2023
},
2124
})
25+
return response.data
2226
}

0 commit comments

Comments
 (0)