diff --git a/package.json b/package.json index 12d3973a..071d6271 100644 --- a/package.json +++ b/package.json @@ -19,13 +19,9 @@ "sideEffects": false, "dependencies": { "@api-platform/api-doc-parser": "^0.16.2", - "history": "^5.0.0", "jsonld": "^8.1.0", "lodash.isplainobject": "^4.0.6", - "prop-types": "^15.6.2", - "react-admin": "^5.0.3", - "react-error-boundary": "^4.0.13", - "@tanstack/react-query": "^5.49.2" + "react-admin": "^5.0.3" }, "devDependencies": { "@babel/preset-env": "^7.23.3", diff --git a/src/useOnSubmit.test.tsx b/src/useOnSubmit.test.tsx index 34ac313e..3820cafd 100644 --- a/src/useOnSubmit.test.tsx +++ b/src/useOnSubmit.test.tsx @@ -1,10 +1,11 @@ import * as React from 'react'; import { jest } from '@jest/globals'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { render, waitFor } from '@testing-library/react'; import type { CreateResult, RaRecord, UpdateResult } from 'react-admin'; import { DataProviderContext, testDataProvider } from 'react-admin'; import { MemoryRouter, Route, Routes } from 'react-router-dom'; + import useOnSubmit from './useOnSubmit.js'; import schemaAnalyzer from './hydra/schemaAnalyzer.js'; import { API_FIELDS_DATA } from './__fixtures__/parsedData.js'; diff --git a/src/useOnSubmit.ts b/src/useOnSubmit.ts index a424aa5f..dbc2a8ef 100644 --- a/src/useOnSubmit.ts +++ b/src/useOnSubmit.ts @@ -3,6 +3,7 @@ import { useCreate, useNotify, useRedirect, useUpdate } from 'react-admin'; import type { HttpError, RaRecord } from 'react-admin'; import { useParams } from 'react-router-dom'; import lodashIsPlainObject from 'lodash.isplainobject'; + import getIdentifierValue from './getIdentifierValue.js'; import type { SubmissionErrors, UseOnSubmitProps } from './types.js'; diff --git a/yarn.lock b/yarn.lock index 2d441d5f..45226366 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1063,7 +1063,7 @@ resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== -"@babel/runtime@^7.12.5", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.3", "@babel/runtime@^7.23.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.12.5", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.3", "@babel/runtime@^7.23.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.7.tgz#f4f0d5530e8dbdf59b3451b9b3e594b6ba082e12" integrity sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw== @@ -2888,7 +2888,7 @@ resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.49.1.tgz#09167842123eddaf47465376f3c835cf59b9f1e9" integrity sha512-JnC9ndmD1KKS01Rt/ovRUB1tmwO7zkyXAyIxN9mznuJrcNtOrkmOnQqdJF2ib9oHzc2VxHomnEG7xyfo54Npkw== -"@tanstack/react-query@^5.49.2", "@tanstack/react-query@^5.8.4": +"@tanstack/react-query@^5.8.4": version "5.49.2" resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.49.2.tgz#d9c08f8eb62890f5274608f8954ab1709912ef3c" integrity sha512-6rfwXDK9BvmHISbNFuGd+wY3P44lyW7lWiA9vIFGT/T0P9aHD1VkjTvcM4SDAIbAQ9ygEZZoLt7dlU1o3NjMVA== @@ -6885,13 +6885,6 @@ he@^1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== -history@^5.0.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/history/-/history-5.3.0.tgz#1548abaa245ba47992f063a0783db91ef201c73b" - integrity sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ== - dependencies: - "@babel/runtime" "^7.7.6" - hoist-non-react-statics@^3.3.1: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"