new sdk of staffs to front

This commit is contained in:
José Salazar
2025-11-21 14:16:11 -05:00
parent 4ef479ef1c
commit 7e35a589fd
24 changed files with 2349 additions and 31 deletions

View File

@@ -12,12 +12,16 @@ For each operation, there is a wrapper hook that can be used to call the operati
Here are all of the hooks that get generated:
```ts
import { useListEvents, useCreateEvent } from '@dataconnect/generated/react';
import { useListStaff, useCreateEvent, useListEvents, useCreateStaff } from '@dataconnect/generated/react';
// The types of these hooks are available in react/index.d.ts
const { data, isPending, isSuccess, isError, error } = useListStaff();
const { data, isPending, isSuccess, isError, error } = useCreateEvent(createEventVars);
const { data, isPending, isSuccess, isError, error } = useListEvents();
const { data, isPending, isSuccess, isError, error } = useCreateEvent(createEventVars);
const { data, isPending, isSuccess, isError, error } = useCreateStaff(createStaffVars);
```
@@ -56,14 +60,20 @@ If a user is not using a supported framework, they can use the generated SDK dir
Here's an example of how to use it with the first 5 operations:
```js
import { listEvents, createEvent } from '@dataconnect/generated';
import { listStaff, createEvent, listEvents, createStaff } from '@dataconnect/generated';
// Operation listEvents:
const { data } = await ListEvents(dataConnect);
// Operation listStaff:
const { data } = await ListStaff(dataConnect);
// Operation CreateEvent: For variables, look at type CreateEventVars in ../index.d.ts
const { data } = await CreateEvent(dataConnect, createEventVars);
// Operation listEvents:
const { data } = await ListEvents(dataConnect);
// Operation CreateStaff: For variables, look at type CreateStaffVars in ../index.d.ts
const { data } = await CreateStaff(dataConnect, createStaffVars);
```