mirror of
https://github.com/fastapi/full-stack-fastapi-template.git
synced 2026-11-03 20:36:27 +00:00
Migrate Playwright privateApi helper to new client API
This commit is contained in:
@@ -1,8 +1,11 @@
|
|||||||
// Note: the `PrivateService` is only available when generating the client
|
// Note: the `PrivateService` is only available when generating the client
|
||||||
// for local environments
|
// for local environments
|
||||||
import { OpenAPI, PrivateService } from "../../src/client"
|
import { PrivateService } from "../../src/client"
|
||||||
|
import { client } from "../../src/client/client.gen"
|
||||||
|
|
||||||
OpenAPI.BASE = `${process.env.VITE_API_URL}`
|
client.setConfig({
|
||||||
|
baseURL: `${process.env.VITE_API_URL}`,
|
||||||
|
})
|
||||||
|
|
||||||
export const createUser = async ({
|
export const createUser = async ({
|
||||||
email,
|
email,
|
||||||
@@ -11,12 +14,13 @@ export const createUser = async ({
|
|||||||
email: string
|
email: string
|
||||||
password: string
|
password: string
|
||||||
}) => {
|
}) => {
|
||||||
return await PrivateService.createUser({
|
const response = await PrivateService.createUser({
|
||||||
requestBody: {
|
body: {
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
is_verified: true,
|
is_verified: true,
|
||||||
full_name: "Test User",
|
full_name: "Test User",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
return response.data
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user