Skip to content
Snippets Groups Projects
Verified Commit 3d04bc94 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: create fdo

parent 3fa79493
Branches
No related tags found
No related merge requests found
Pipeline #48212 failed
......@@ -19,26 +19,36 @@ COPY --from=deps /app/refine/node_modules ./node_modules
COPY . .
ENV EXPRESS_PUBLIC_API_URL=/api
RUN npm run build
FROM base AS runner
ENV NODE_ENV production
COPY --from=builder /app/refine/public ./public
RUN mkdir .next
RUN chown refine:nodejs .next
COPY --from=builder --chown=refine:nodejs /app/refine/.next/standalone ./
COPY --from=builder --chown=refine:nodejs /app/refine/.next/static ./.next/static
USER refine
EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME "0.0.0.0"
CMD ["node", "server.js"]
ENV EXPRESS_PUBLIC_API_URL=http://localhost:8000/api
CMD ["npm", "run", "dev"]
#ENV EXPRESS_PUBLIC_API_URL=http://localhost:8000/api
#RUN npm run build
#
#FROM base AS runner
#
#ENV NODE_ENV production
#
#COPY --from=builder /app/refine/public ./public
#
#RUN mkdir .next
#RUN chown refine:nodejs .next
#
#COPY --from=builder --chown=refine:nodejs /app/refine/.next/standalone ./
#COPY --from=builder --chown=refine:nodejs /app/refine/.next/static ./.next/static
#
#USER refine
#
#EXPOSE 3000
#
#ENV PORT 3000
#ENV HOSTNAME "0.0.0.0"
#
#ENV EXPRESS_PUBLIC_API_URL=http://localhost:8000/api
##CMD ["node", "server.js"]
#CMD ["npm", "run", "dev"]
build.log 0 → 100644
#0 building with "default" instance using docker driver
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.06kB done
#1 DONE 0.0s
#2 [auth] refinedev/node:pull token for registry-1.docker.io
#2 DONE 0.0s
#3 [internal] load metadata for docker.io/refinedev/node:18
#3 DONE 1.1s
#4 [internal] load .dockerignore
#4 transferring context: 2B done
#4 DONE 0.0s
#5 [base 1/1] FROM docker.io/refinedev/node:18@sha256:f69e6f978a791300bb65ca639a27f1e6d4606f6324382de521ce39001615d25c
#5 CACHED
#6 [internal] load build context
#6 ...
#7 [deps 1/3] RUN apk add --no-cache libc6-compat
#7 0.189 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
#7 0.415 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
#7 0.900 (1/3) Installing musl-obstack (1.2.3-r2)
#7 0.921 (2/3) Installing libucontext (1.2-r2)
#7 0.940 (3/3) Installing gcompat (1.1.0-r4)
#7 0.965 OK: 10 MiB in 20 packages
#7 DONE 1.8s
#6 [internal] load build context
#6 transferring context: 182.06MB 5.1s
#6 transferring context: 182.06MB 5.1s done
#6 DONE 5.3s
#8 [deps 2/3] COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
#8 DONE 2.2s
#9 [deps 3/3] RUN if [ -f yarn.lock ]; then yarn --frozen-lockfile; elif [ -f package-lock.json ]; then npm ci; elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; else echo "Lockfile not found." && exit 1; fi
#9 8.695 npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
#9 8.719 npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
#9 8.754 npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
#9 8.988 npm WARN deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
#9 9.020 npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
#9 9.251 npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
#9 9.270 npm WARN deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
#9 36.92
#9 36.92 added 1056 packages, and audited 1057 packages in 37s
#9 36.92
#9 36.92 265 packages are looking for funding
#9 36.92 run `npm fund` for details
#9 36.93
#9 36.93 found 0 vulnerabilities
#9 36.93 npm notice
#9 36.93 npm notice New minor version of npm available! 10.2.3 -> 10.5.0
#9 36.93 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.5.0>
#9 36.93 npm notice Run `npm install -g npm@10.5.0` to update!
#9 36.93 npm notice
#9 DONE 42.0s
#10 [builder 1/3] COPY --from=deps /app/refine/node_modules ./node_modules
#10 DONE 14.9s
#11 [builder 2/3] COPY . .
#11 DONE 40.4s
#12 [builder 3/3] RUN npm run build
#12 1.559
#12 1.559 > fdo-manager-webui-refine@0.1.0 build
#12 1.559 > refine build --debug
#12 1.559
#12 2.828 ╭──────────────────────────────────────────────────────────────────────────────╮
#12 2.828 │ │
#12 2.828 │ - refine Devtools beta version is out! To install in your project, just run │
#12 2.828 │ npm run refine devtools init. https://s.refine.dev/devtools-beta │
#12 2.828 │ │
#12 2.828 │ - Hello from refine team! Hope you enjoy! Join our Discord community to get │
#12 2.828 │ help and discuss with other users. https://discord.gg/refine │
#12 2.828 │ │
#12 2.828 ╰──────────────────────────────────────────────────────────────────────────────╯
#12 4.288 Attention: Next.js now collects completely anonymous telemetry regarding usage.
#12 4.288 This information is used to shape Next.js' roadmap and prioritize features.
#12 4.288 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
#12 4.288 https://nextjs.org/telemetry
#12 4.288
#12 4.427   Linting and checking validity of types ...
#12 12.95   Creating an optimized production build ...
#12 25.83 ✓ Compiled successfully
#12 25.83   Collecting page data ...
#12 29.43   Generating static pages (0/17) ...
#12 29.54 react-i18next:: You will need to pass in an i18next instance by using initReactI18next
#12 29.54 react-i18next:: You will need to pass in an i18next instance by using initReactI18next
#12 29.54 react-i18next:: You will need to pass in an i18next instance by using initReactI18next
#12 29.54 react-i18next:: You will need to pass in an i18next instance by using initReactI18next
#12 29.54 react-i18next:: You will need to pass in an i18next instance by using initReactI18next
#12 29.62 react-i18next:: You will need to pass in an i18next instance by using initReactI18next
#12 29.64   Generating static pages (4/17)
#12 29.76   Generating static pages (8/17)
#12 29.82   Generating static pages (12/17)
#12 29.82 getStaticProps { locales: [ 'en', 'de' ], locale: 'en', defaultLocale: 'en' } {
#12 29.82 _nextI18Next: {
#12 29.82 initialI18nStore: { en: [Object] },
#12 29.82 userConfig: {
#12 29.82 i18n: [Object],
#12 29.82 localePath: '/app/refine/public/locales',
#12 29.82 default: [Object]
#12 29.82 }
#12 29.82 }
#12 29.82 }
#12 29.82 getStaticProps { locales: [ 'en', 'de' ], locale: 'de', defaultLocale: 'en' } {
#12 29.82 _nextI18Next: {
#12 29.82 initialI18nStore: { en: [Object] },
#12 29.82 userConfig: {
#12 29.82 i18n: [Object],
#12 29.82 localePath: '/app/refine/public/locales',
#12 29.82 default: [Object]
#12 29.82 }
#12 29.82 }
#12 29.82 }
#12 29.95 react-i18next:: You will need to pass in an i18next instance by using initReactI18next
#12 30.10 ✓ Generating static pages (17/17)
#12 32.97   Finalizing page optimization ...
#12 32.97   Collecting build traces ...
#12 34.95 Redirects
#12 34.95
#12 34.95 ┌ source: /:path+/
#12 34.95 ├ destination: /:path+
#12 34.95 └ permanent: true
#12 34.95
#12 34.95
#12 57.56
#12 57.56 Route (pages) Size First Load JS
#12 57.56 ┌ ○ / 272 B 406 kB
#12 57.56 ├ /_app 0 B 406 kB
#12 57.56 ├ λ /[...catchAll] 284 B 406 kB
#12 57.56 ├ ○ /404 681 B 407 kB
#12 57.56 ├ λ /api/auth/[...nextauth] 0 B 406 kB
#12 57.56 ├ ○ /fdo 4.82 kB 411 kB
#12 57.56 ├ λ /fdo/show/[id] 817 B 407 kB
#12 57.56 ├ ○ /info 608 B 407 kB
#12 57.56 ├ λ /login 732 B 407 kB
#12 57.56 └ ○ /repositories (563 ms) 95.4 kB 502 kB
#12 57.56 + First Load JS shared by all 406 kB
#12 57.56 ├ chunks/framework-467b11a89995b152.js 45.4 kB
#12 57.56 ├ chunks/main-0577a5cff876d7ca.js 33.8 kB
#12 57.56 ├ chunks/pages/_app-aa9ccd582f08290e.js 326 kB
#12 57.56 └ chunks/webpack-6af0e3c12b874bb0.js 1.03 kB
#12 57.56
#12 57.57 λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
#12 57.57 ○ (Static) automatically rendered as static HTML (uses no initial props)
#12 57.57
#12 58.76 npm notice
#12 58.76 npm notice New minor version of npm available! 10.2.3 -> 10.5.0
#12 58.76 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.5.0>
#12 58.76 npm notice Run `npm install -g npm@10.5.0` to update!
#12 58.76 npm notice
#12 DONE 59.1s
#13 [runner 1/5] COPY --from=builder /app/refine/public ./public
#13 DONE 0.6s
#14 [runner 2/5] RUN mkdir .next
#14 DONE 1.3s
#15 [runner 3/5] RUN chown refine:nodejs .next
#15 DONE 1.2s
#16 [runner 4/5] COPY --from=builder --chown=refine:nodejs /app/refine/.next/standalone ./
#16 DONE 1.8s
#17 [runner 5/5] COPY --from=builder --chown=refine:nodejs /app/refine/.next/static ./.next/static
#17 DONE 0.8s
#18 exporting to image
#18 exporting layers
#18 exporting layers 1.3s done
#18 writing image sha256:facd277f8e61f6c6b52c63a1832abd99fbd10cd4b382d7aecc2004f7e1ff2503 0.0s done
#18 naming to docker.io/library/fdo-manager-webui:latest 0.1s done
#18 DONE 1.4s
This diff is collapsed.
......@@ -6,36 +6,38 @@
"node": ">=18.0.0"
},
"scripts": {
"prepare": "echo \"export const version=$(npm pkg get version --workspaces=false);\" > src/version.js",
"dev": "npm run prepare && cross-env NODE_OPTIONS=--max_old_space_size=4096 refine dev",
"build": "refine build",
"make_version": "echo \"export const version=$(npm pkg get version --workspaces=false);\" | tr '\"' \"'\" > src/version.js",
"dev": "cross-env NODE_OPTIONS=--max_old_space_size=4096 refine dev",
"build": "refine build --debug",
"start": "refine start",
"lint": "eslint '{src,pages}/**/*.{js,jsx,ts,tsx}'",
"lint": "grep -c \"$(npm pkg get version | tr '\"' \"'\")\" src/version.js && eslint '{src,pages}/**/*.{js,jsx,ts,tsx}'",
"refine": "refine",
"generate": "rm -r src/api/* && npx @openapitools/openapi-generator-cli generate -i ../fdo-manager-service/api/src/main/resources/api.yaml -g typescript-axios -o src/api/"
},
"dependencies": {
"@auth/unstorage-adapter": "^1.6.0",
"@emotion/react": "^11.8.2",
"@emotion/styled": "^11.8.1",
"@mui/icons-material": "^5.8.3",
"@mui/lab": "^5.0.0-alpha.85",
"@mui/material": "^5.8.6",
"@mui/x-data-grid": "^6.6.0",
"@refinedev/cli": "^2.16.1",
"@refinedev/core": "^4.47.1",
"@refinedev/devtools": "^1.1.32",
"@refinedev/cli": "^2.16.26",
"@refinedev/core": "^4.47.2",
"@refinedev/devtools": "^1.1.34",
"@refinedev/inferencer": "^4.5.20",
"@refinedev/kbar": "^1.3.6",
"@refinedev/mui": "^5.14.4",
"@refinedev/nextjs-router": "^5.5.7",
"@refinedev/nextjs-router": "^6.0.0",
"@refinedev/react-hook-form": "^4.8.14",
"@refinedev/simple-rest": "^5.0.1",
"next": "^13.0.6",
"next-auth": "^4.20.1",
"next-auth": "^4.24.6",
"next-i18next": "^8.9.0",
"nookies": "^2.5.2",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react-dom": "^18.0.0",
"unstorage": "^1.10.1"
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.1.0",
......
import { type AuthBindings, Refine } from '@refinedev/core'
import { AuthBindings, Refine } from '@refinedev/core'
import { RefineKbar, RefineKbarProvider } from '@refinedev/kbar'
import {
RefineSnackbarProvider,
......@@ -6,12 +6,13 @@ import {
ThemedTitleV2,
notificationProvider
} from '@refinedev/mui'
import routerProvider, {
import routerProvider from '@refinedev/nextjs-router'
import {
UnsavedChangesNotifier
} from '@refinedev/nextjs-router'
} from '@refinedev/nextjs-router/pages'
import type { NextPage } from 'next'
import { SessionProvider, signIn, signOut, useSession } from 'next-auth/react'
import { type AppProps } from 'next/app'
import { AppProps } from 'next/app'
import { useRouter } from 'next/router'
import React from 'react'
......@@ -92,15 +93,19 @@ const App = (props: React.PropsWithChildren) => {
return null
},
getIdentity: async () => {
return data
/*
if (data?.user) {
const { user } = data
return {
name: user.name,
avatar: user.image
avatar: user.image,
data: data,
}
}
return null
*/
}
}
......@@ -134,7 +139,7 @@ const App = (props: React.PropsWithChildren) => {
show: '/repositories/show/:id'
}, {
name: 'info',
list: '/info'
show: '/info'
}]}
>
{props.children}
......
import NextAuth from 'next-auth'
import KeycloakProvider from 'next-auth/providers/keycloak'
//import { UnstorageAdapter } from '@auth/unstorage-adapter'
//import { createStorage } from 'unstorage'
//const storage = createStorage()
export const authOptions = {
//adapter: UnstorageAdapter(storage),
session: {
maxAge: 172800 // 48h
},
debug: true,
// Configure one or more authentication providers
providers: [
// !!! Should be stored in .env file.
KeycloakProvider({
clientId: 'fdo-manager-webui',
clientSecret: 'ay7l6jhECSohAZsEp6HYOaoXdARMQCei',
issuer: 'http://localhost:8080/realms/FDO%20Manager',
issuer: 'http://localhost:8000/auth/realms/fdo-manager',
authorization: { params: { scope: 'openid profile' } },
profile (profile) {
console.log('### profile', profile, '### ### ###')
return {
id: profile.sub,
name: profile.name ?? profile.preferred_username,
email: profile.email,
image: 'https://faces-img.xcdn.link/thumb-lorem-face-6312_thumb.jpg'
name: profile.name ?? profile.preferred_username
}
}
})
],
callbacks: {
async signIn ({ user, account, profile, email, credentials }: any) {
console.log('### signIn', user, account, profile, email, credentials, '### ### ###')
return true
},
async session ({ session, user, token }: any) {
console.log('### session', session, user, token, '### ### ###')
return { ...session,
account: token.account,
}
},
async jwt ({ token, user, account, profile, isNewUser }: any) {
console.log('### jwt', token, user, account, profile, isNewUser, '### ### ###')
if ( account ) {
return { ...token,
account: account
}
}
return token
}
},
secret: 'UItTuD1HcGXIj8ZfHUswhYdNd40Lc325R8VlxQPUoR0='
}
export default NextAuth(authOptions)
import React from 'react'
import { FdoCreate } from '../../src/components/fdos'
import { GetServerSideProps } from 'next'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
const CreateFDO = () => {
return <FdoCreate/>
}
export default CreateFDO
export const getServerSideProps: GetServerSideProps<{}> = async (context) => {
const translateProps = await serverSideTranslations(context.locale ?? 'en', [
'common'
])
return {
props: {
...translateProps
}
}
}
import React from 'react'
import { ErrorComponent } from '../../../../src/components/ErrorComponent'
import { type GetServerSideProps } from 'next'
import { GetServerSideProps } from 'next'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { useShow } from '@refinedev/core'
import { Show } from '@refinedev/mui'
import { Typography } from '@mui/material'
import CircularProgress from '@mui/material/CircularProgress'
import Box from '@mui/material/Box'
import Chip from '@mui/material/Chip'
const ShowFDO = () => {
const { queryResult: { isError, error, isLoading, data }, showId } = useShow({
......@@ -25,9 +26,10 @@ const ShowFDO = () => {
return (
<Show
isLoading={isLoading}
title={<Typography variant="h5">Custom Title</Typography>}
title={<Typography variant="h5">{ showId }{ !isLoading && (data?.data?.isFdo ? <Chip label="FDO" color="success" variant="outlined" /> : <Chip label="Not an FDO" color="error" variant="outlined" />)}</Typography>}
>
{ isLoading && <Box sx={{ textAlign: 'center' }}><CircularProgress/></Box>}
<Box>This is FDO { showId }</Box>
</Show>
)
......@@ -36,14 +38,11 @@ const ShowFDO = () => {
export default ShowFDO
export const getServerSideProps: GetServerSideProps<{}> = async (context) => {
console.log('getServerSideProps', context)
const data = undefined // TODO
const translateProps = await serverSideTranslations(context.locale ?? 'en', [
'common'
])
return {
notFound: true,
props: {
...translateProps
}
......
......@@ -4,8 +4,12 @@ import Paper from '@mui/material/Paper'
import Box from '@mui/material/Box'
import { styled } from '@mui/material/styles'
import { FDO_MANAGER_WEBUI_VERSION } from '../../src/constants'
import { GetServerSideProps } from 'next'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { useOne } from '@refinedev/core'
import { useOne, useShow, useApiUrl } from '@refinedev/core'
import { Show } from '@refinedev/mui'
import Link from '@mui/material/Link'
const Item = styled(Paper)(({ theme }) => ({
backgroundColor: theme.palette.mode === 'dark' ? '#1A2027' : '#fff',
......@@ -16,19 +20,35 @@ const Item = styled(Paper)(({ theme }) => ({
}))
const Info = () => {
const { data, isLoading } = useOne({ resource: 'info', id: undefined })
const { queryResult: { data, isLoading } } = useShow({ resource: 'info', id: '' })
if (isLoading) return <div>Loading...</div>
console.log('info', data, isLoading)
const apiUrl = useApiUrl()
return (
<Show>
<Box>
<Stack>
<Item>FDO Manager WebUI Version: {FDO_MANAGER_WEBUI_VERSION}</Item>
<Item>FDO Manager Service Version: {data?.data?.fdoServiceVersion}</Item>
<Item>FOD Manager API endpoint: <Link href={apiUrl} target="_blank" rel="noopener">{apiUrl}</Link></Item>
<Item>FDO Manager SDK Version: {data?.data?.fdoSdkVersion}</Item>
</Stack>
</Box>
</Show>
)
}
export default Info
export const getServerSideProps: GetServerSideProps<{}> = async (context) => {
const translateProps = await serverSideTranslations(context.locale ?? 'en', [
'common'
])
return {
props: {
...translateProps
}
}
}
......@@ -5,11 +5,12 @@ import Typography from '@mui/material/Typography'
import { useLogin, useTranslate } from '@refinedev/core'
import { ThemedTitleV2 } from '@refinedev/mui'
import { type GetServerSideProps } from 'next'
import { GetServerSideProps } from 'next'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { getServerSession } from 'next-auth'
import { authOptions } from '../api/auth/[...nextauth]'
import logo from '../../src/components/fdo_logo'
export default function Login () {
......
import React from 'react'
import { GetServerSideProps } from 'next'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { RepositoriesList } from '../../src/components/repositories'
......@@ -7,3 +9,15 @@ const ListRepositories = () => {
}
export default ListRepositories
export const getServerSideProps: GetServerSideProps<{}> = async (context) => {
const translateProps = await serverSideTranslations(context.locale ?? 'en', [
'common'
])
return {
props: {
...translateProps
}
}
}
import { IResourceComponentsProps, useList, HttpError } from '@refinedev/core'
import { useGetIdentity } from "@refinedev/core";
import { Create, SaveButton } from '@refinedev/mui'
import { useTheme, styled } from '@mui/material/styles'
......@@ -109,15 +110,30 @@ const StepData: React.FC<any> = ({ register, errors }) => {
}
export const FdoCreate: React.FC<IResourceComponentsProps> = () => {
const identity = useGetIdentity()
const access_token = identity.data?.account?.access_token;
console.log('access_token: ', access_token)
const formRet = useStepsForm<IRepository, HttpError, any>({ defaultValues: { repository: '' }, refineCoreProps: { meta: { headers: { "Authentication" : `Bearer: ${access_token}` }}}});
console.log('formRet', formRet)
const {
saveButtonProps,
refineCore: { formLoading, onFinish },
refineCore: {
formLoading, onFinish,
redirect,
mutationResult: { data, error, isLoading }
},
register,
handleSubmit,
control,
formState: { errors },
steps: { currentStep, gotoStep }
} = useStepsForm<IRepository, HttpError, any>({ defaultValues: { repository: '' } })
} = formRet
if (data) {
console.log('redirect', data.data.pid)
redirect('show', data.data.pid)
}
const onSubmit = (data: any) => {
console.log('data', data)
......
......@@ -31,14 +31,15 @@ const apiDataProvider = (apiUrl: string): DataProvider => {
const callOperation = async (resource: string, operation: string, kwargs: any) => {
const resourceObj: any = apiResources[resource] || apiResources.default
const func: any = apiOperations[resource][operation]
var headers = kwargs?.meta?.headers
if (func && (operation === 'get' || operation === 'list')) {
if (kwargs.id) {
if (kwargs?.id) {
return (await func.apply(resourceObj, [kwargs.id])).data
} else {
return (await func.apply(resourceObj)).data
}
} else if (func && operation === 'create') {
return await func.apply(resourceObj, kwargs.variables)
return await func.apply(resourceObj, kwargs.variables.concat({headers: headers}));
}
throw new Error('Not implemented')
}
......@@ -52,18 +53,17 @@ const apiDataProvider = (apiUrl: string): DataProvider => {
return { data: data.data }
},
create: async ({ resource, variables, meta }) => {
console.log('create', resource, variables)
const response = await callOperation(resource, 'create', { variables })
console.log('create', resource, variables, meta)
const response = await callOperation(resource, 'create', { variables, meta })
if (response.status === 201) {
const newLocation = response.headers.location
console.log('newLocation', newLocation)
const newData = await getNewlyCreated(newLocation)
console.log('newData', newData)
return { data: newData.data.data }
} else {
// TODO
throw new Error('Create with anything else than 201 not implemented.')
}
console.log('create.response', response)
return { data: response }
},
update: async () => {
throw new Error('Not implemented')
......@@ -72,6 +72,7 @@ const apiDataProvider = (apiUrl: string): DataProvider => {
throw new Error('Not implemented')
},
getList: async ({ resource, pagination, sorters, filters, meta }) => {
console.log('getList', resource, meta)
const data = (await callOperation(resource, 'list', { pagination, sorters, filters, meta })).data
return { data, total: data.length }
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment