new sdk of staffs to front
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user