new sdk with full funcionts of ventors
This commit is contained in:
@@ -12,13 +12,9 @@ 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 { useListVendor, useCreateEvent, useListEvents, useCreateStaff, useListStaff, useCreateVendor } from '@dataconnect/generated/react';
|
||||
import { useListEvents, useCreateStaff, useListStaff, useCreateVendor, useUpdateVendor, useDeleteVendor, useListVendor, useGetVendorById, useFilterVendors, useCreateEvent } from '@dataconnect/generated/react';
|
||||
// The types of these hooks are available in react/index.d.ts
|
||||
|
||||
const { data, isPending, isSuccess, isError, error } = useListVendor();
|
||||
|
||||
const { data, isPending, isSuccess, isError, error } = useCreateEvent(createEventVars);
|
||||
|
||||
const { data, isPending, isSuccess, isError, error } = useListEvents();
|
||||
|
||||
const { data, isPending, isSuccess, isError, error } = useCreateStaff(createStaffVars);
|
||||
@@ -27,6 +23,18 @@ const { data, isPending, isSuccess, isError, error } = useListStaff();
|
||||
|
||||
const { data, isPending, isSuccess, isError, error } = useCreateVendor(createVendorVars);
|
||||
|
||||
const { data, isPending, isSuccess, isError, error } = useUpdateVendor(updateVendorVars);
|
||||
|
||||
const { data, isPending, isSuccess, isError, error } = useDeleteVendor(deleteVendorVars);
|
||||
|
||||
const { data, isPending, isSuccess, isError, error } = useListVendor();
|
||||
|
||||
const { data, isPending, isSuccess, isError, error } = useGetVendorById(getVendorByIdVars);
|
||||
|
||||
const { data, isPending, isSuccess, isError, error } = useFilterVendors(filterVendorsVars);
|
||||
|
||||
const { data, isPending, isSuccess, isError, error } = useCreateEvent(createEventVars);
|
||||
|
||||
```
|
||||
|
||||
Here's an example from a different generated SDK:
|
||||
@@ -64,15 +72,9 @@ 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 { listVendor, createEvent, listEvents, createStaff, listStaff, createVendor } from '@dataconnect/generated';
|
||||
import { listEvents, createStaff, listStaff, createVendor, updateVendor, deleteVendor, listVendor, getVendorById, filterVendors, createEvent } from '@dataconnect/generated';
|
||||
|
||||
|
||||
// Operation listVendor:
|
||||
const { data } = await ListVendor(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);
|
||||
|
||||
@@ -85,5 +87,23 @@ const { data } = await ListStaff(dataConnect);
|
||||
// Operation CreateVendor: For variables, look at type CreateVendorVars in ../index.d.ts
|
||||
const { data } = await CreateVendor(dataConnect, createVendorVars);
|
||||
|
||||
// Operation UpdateVendor: For variables, look at type UpdateVendorVars in ../index.d.ts
|
||||
const { data } = await UpdateVendor(dataConnect, updateVendorVars);
|
||||
|
||||
// Operation DeleteVendor: For variables, look at type DeleteVendorVars in ../index.d.ts
|
||||
const { data } = await DeleteVendor(dataConnect, deleteVendorVars);
|
||||
|
||||
// Operation listVendor:
|
||||
const { data } = await ListVendor(dataConnect);
|
||||
|
||||
// Operation getVendorById: For variables, look at type GetVendorByIdVars in ../index.d.ts
|
||||
const { data } = await GetVendorById(dataConnect, getVendorByIdVars);
|
||||
|
||||
// Operation filterVendors: For variables, look at type FilterVendorsVars in ../index.d.ts
|
||||
const { data } = await FilterVendors(dataConnect, filterVendorsVars);
|
||||
|
||||
// Operation CreateEvent: For variables, look at type CreateEventVars in ../index.d.ts
|
||||
const { data } = await CreateEvent(dataConnect, createEventVars);
|
||||
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user