fix: Adapted File-provider to be default dataProvider

This commit is contained in:
Tania Gutierrez 2024-03-15 15:59:02 -04:00
parent f67ebbd98a
commit e559e4d709
Signed by: riobuenoDevelops
GPG Key ID: 53133EB28EB7E801
2 changed files with 14 additions and 13 deletions

View File

@ -1,15 +1,10 @@
import type { BaseRecord, CreateManyParams, CreateManyResponse, CreateParams, CreateResponse, CustomParams, CustomResponse, DataProvider, DeleteManyParams, DeleteManyResponse, DeleteOneParams, DeleteOneResponse, GetListParams, GetListResponse, GetManyParams, GetManyResponse, GetOneParams, GetOneResponse, UpdateManyParams, UpdateManyResponse, UpdateParams, UpdateResponse } from "@refinedev/core"; import type { DataProvider } from "@refinedev/core";
export class PortalFilesProvider implements DataProvider { export const defaultProvider: DataProvider = {
getList: <TData extends BaseRecord = BaseRecord>(params: GetListParams) => Promise<GetListResponse<TData>>; getList: () => { throw Error("Not Implemented") },
getMany?: (<TData extends BaseRecord = BaseRecord>(params: GetManyParams) => Promise<GetManyResponse<TData>>) | undefined; getOne: () => { throw Error("Not Implemented") },
getOne: <TData extends BaseRecord = BaseRecord>(params: GetOneParams) => Promise<GetOneResponse<TData>>; update: () => { throw Error("Not Implemented") },
create: <TData extends BaseRecord = BaseRecord, TVariables = {}>(params: CreateParams<TVariables>) => Promise<CreateResponse<TData>>; create: () => { throw Error("Not Implemented") },
createMany?: (<TData extends BaseRecord = BaseRecord, TVariables = {}>(params: CreateManyParams<TVariables>) => Promise<CreateManyResponse<TData>>) | undefined; deleteOne: () => { throw Error("Not Implemented") },
update: <TData extends BaseRecord = BaseRecord, TVariables = {}>(params: UpdateParams<TVariables>) => Promise<UpdateResponse<TData>>; getApiUrl: () => "",
updateMany?: (<TData extends BaseRecord = BaseRecord, TVariables = {}>(params: UpdateManyParams<TVariables>) => Promise<UpdateManyResponse<TData>>) | undefined;
deleteOne: <TData extends BaseRecord = BaseRecord, TVariables = {}>(params: DeleteOneParams<TVariables>) => Promise<DeleteOneResponse<TData>>;
deleteMany?: (<TData extends BaseRecord = BaseRecord, TVariables = {}>(params: DeleteManyParams<TVariables>) => Promise<DeleteManyResponse<TData>>) | undefined;
getApiUrl: () => string;
custom?: (<TData extends BaseRecord = BaseRecord, TQuery = unknown, TPayload = unknown>(params: CustomParams<TQuery, TPayload>) => Promise<CustomResponse<...>>) | undefined;
} }

View File

@ -14,6 +14,7 @@ import '@fontsource-variable/manrope';
import {Refine} from "@refinedev/core"; import {Refine} from "@refinedev/core";
import {PortalAuthProvider} from "~/data/auth-provider.js"; import {PortalAuthProvider} from "~/data/auth-provider.js";
import routerProvider from "@refinedev/remix-router"; import routerProvider from "@refinedev/remix-router";
import { defaultProvider } from "./data/file-provider";
export const links: LinksFunction = () => [ export const links: LinksFunction = () => [
{ rel: "stylesheet", href: stylesheet }, { rel: "stylesheet", href: stylesheet },
@ -42,6 +43,11 @@ export default function App() {
<Refine <Refine
authProvider={PortalAuthProvider.create("https://alpha.pinner.xyz")} authProvider={PortalAuthProvider.create("https://alpha.pinner.xyz")}
routerProvider={routerProvider} routerProvider={routerProvider}
dataProvider={defaultProvider}
resources={[
{ name: 'files' },
{ name: 'users' }
]}
> >
<Outlet/> <Outlet/>
</Refine> </Refine>