ADD POST REQUEST view
This commit is contained in:
parent
372b91c1ed
commit
1f5562c122
40
package-lock.json
generated
40
package-lock.json
generated
|
|
@ -8,6 +8,7 @@
|
|||
"name": "website",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"@tanstack/react-query": "^5.64.2",
|
||||
"antd": "^5.21.1",
|
||||
"axios": "^1.7.5",
|
||||
"formik": "^2.4.6",
|
||||
|
|
@ -1634,6 +1635,32 @@
|
|||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@tanstack/query-core": {
|
||||
"version": "5.64.2",
|
||||
"resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.64.2.tgz",
|
||||
"integrity": "sha512-hdO8SZpWXoADNTWXV9We8CwTkXU88OVWRBcsiFrk7xJQnhm6WRlweDzMD+uH+GnuieTBVSML6xFa17C2cNV8+g==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/tannerlinsley"
|
||||
}
|
||||
},
|
||||
"node_modules/@tanstack/react-query": {
|
||||
"version": "5.64.2",
|
||||
"resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.64.2.tgz",
|
||||
"integrity": "sha512-3pakNscZNm8KJkxmovvtZ4RaXLyiYYobwleTMvpIGUoKRa8j8VlrQKNl5W8VUEfVfZKkikvXVddLuWMbcSCA1Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tanstack/query-core": "5.64.2"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/tannerlinsley"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^18 || ^19"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/babel__core": {
|
||||
"version": "7.20.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz",
|
||||
|
|
@ -5764,6 +5791,19 @@
|
|||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@tanstack/query-core": {
|
||||
"version": "5.64.2",
|
||||
"resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.64.2.tgz",
|
||||
"integrity": "sha512-hdO8SZpWXoADNTWXV9We8CwTkXU88OVWRBcsiFrk7xJQnhm6WRlweDzMD+uH+GnuieTBVSML6xFa17C2cNV8+g=="
|
||||
},
|
||||
"@tanstack/react-query": {
|
||||
"version": "5.64.2",
|
||||
"resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.64.2.tgz",
|
||||
"integrity": "sha512-3pakNscZNm8KJkxmovvtZ4RaXLyiYYobwleTMvpIGUoKRa8j8VlrQKNl5W8VUEfVfZKkikvXVddLuWMbcSCA1Q==",
|
||||
"requires": {
|
||||
"@tanstack/query-core": "5.64.2"
|
||||
}
|
||||
},
|
||||
"@types/babel__core": {
|
||||
"version": "7.20.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz",
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/react-query": "^5.64.2",
|
||||
"antd": "^5.21.1",
|
||||
"axios": "^1.7.5",
|
||||
"formik": "^2.4.6",
|
||||
|
|
|
|||
13
src/apis/view.ts
Normal file
13
src/apis/view.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import useAddMutation from "./helpers/useAddMutation";
|
||||
|
||||
const API = {
|
||||
GET: "",
|
||||
ADD: "https://tracking.point-dev.net/api/view",
|
||||
DELETE: "",
|
||||
UPDATE: "",
|
||||
};
|
||||
|
||||
const KEY = "view";
|
||||
|
||||
|
||||
export const useSendTopicName = () => useAddMutation(KEY, API.ADD);
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
import { createRoot } from 'react-dom/client';
|
||||
import App from './App.tsx';
|
||||
|
||||
createRoot(document.getElementById('root')!).render(<App />);
|
||||
import App from './App.tsx';
|
||||
import QueryProvider from './lib/ReactQueryProvider.tsx';
|
||||
|
||||
createRoot(document.getElementById('root')!).render(<QueryProvider><App /></QueryProvider>);
|
||||
|
|
|
|||
|
|
@ -6,9 +6,24 @@ import { Spin } from 'antd';
|
|||
import Layout from '../../components/layout/Layout';
|
||||
import { ExternalRedirect } from '../../utils/ExternalRedirect';
|
||||
import { Links } from '../../../data.json';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useSendTopicName } from '../../apis/view';
|
||||
|
||||
const Download = () => {
|
||||
const { DeviceType, setDeviceType }: any = useDetectDeviceType();
|
||||
const location = useLocation();
|
||||
|
||||
const params = new URLSearchParams(location.search);
|
||||
const src = params.get('src');
|
||||
const {mutate,} = useSendTopicName()
|
||||
useEffect(() =>{
|
||||
mutate(
|
||||
{
|
||||
"topic_name": src,
|
||||
"project_name": "zaker"
|
||||
}
|
||||
)
|
||||
},[])
|
||||
|
||||
useEffect(() => {
|
||||
setDeviceType(detectDeviceType());
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user