1+ /* eslint-disable */
12import type { Prisma , Post } from "@prisma/client" ;
23import { useContext } from 'react' ;
3- import { RequestHandlerContext } from '@zenstackhq/next/client ' ;
4- import { request , type RequestOptions } from '@zenstackhq/runtime/client ' ;
4+ import { RequestHandlerContext , type RequestOptions } from '@zenstackhq/react/runtime ' ;
5+ import * as request from '@zenstackhq/react/runtime ' ;
56
67export function usePost ( ) {
78 const { endpoint } = useContext ( RequestHandlerContext ) ;
@@ -21,10 +22,6 @@ export function usePost() {
2122 }
2223 }
2324
24- async function createMany < T extends Prisma . PostCreateManyArgs > ( args : Prisma . SelectSubset < T , Prisma . PostCreateManyArgs > ) {
25- return await request . post < Prisma . SelectSubset < T , Prisma . PostCreateManyArgs > , Prisma . BatchPayload > ( `${ endpoint } /post/createMany` , args , mutate ) ;
26- }
27-
2825 function findMany < T extends Prisma . PostFindManyArgs > ( args ?: Prisma . SelectSubset < T , Prisma . PostFindManyArgs > , options ?: RequestOptions < Array < Prisma . PostGetPayload < T > > > ) {
2926 return request . get < Array < Prisma . PostGetPayload < T > > > ( `${ endpoint } /post/findMany` , args , options ) ;
3027 }
@@ -132,9 +129,5 @@ export function usePost() {
132129 } [ OrderFields ] > ( args : Prisma . SubsetIntersection < T , Prisma . PostGroupByArgs , OrderByArg > & InputErrors , options ?: RequestOptions < { } extends InputErrors ? Prisma . GetPostGroupByPayload < T > : InputErrors > ) {
133130 return request . get < { } extends InputErrors ? Prisma . GetPostGroupByPayload < T > : InputErrors > ( `${ endpoint } /post/groupBy` , args , options ) ;
134131 }
135-
136- function count < T extends Prisma . PostCountArgs > ( args : Prisma . Subset < T , Prisma . PostCountArgs > , options ?: RequestOptions < T extends { select : any ; } ? T [ 'select' ] extends true ? number : Prisma . GetScalarType < T [ 'select' ] , Prisma . PostCountAggregateOutputType > : number > ) {
137- return request . get < T extends { select : any ; } ? T [ 'select' ] extends true ? number : Prisma . GetScalarType < T [ 'select' ] , Prisma . PostCountAggregateOutputType > : number > ( `${ endpoint } /post/count` , args , options ) ;
138- }
139- return { create, createMany, findMany, findUnique, findFirst, update, updateMany, upsert, del, deleteMany, aggregate, groupBy, count } ;
132+ return { create, findMany, findUnique, findFirst, update, updateMany, upsert, del, deleteMany, aggregate, groupBy } ;
140133}
0 commit comments