remove unnecesary code

This commit is contained in:
juan 2025-11-13 18:25:47 +01:00
parent 3371def3b9
commit b3213045ce
5 changed files with 38 additions and 106 deletions

38
package-lock.json generated
View File

@ -24,8 +24,6 @@
"react": "^19.2.0", "react": "^19.2.0",
"react-dom": "^19.2.0", "react-dom": "^19.2.0",
"sonner": "^2.0.7", "sonner": "^2.0.7",
"tailwindcss": "^4.1.17",
"vite-tsconfig-paths": "^5.1.4",
"zod": "^4.1.12" "zod": "^4.1.12"
}, },
"devDependencies": { "devDependencies": {
@ -37,8 +35,10 @@
"@vitejs/plugin-react": "^5.1.1", "@vitejs/plugin-react": "^5.1.1",
"drizzle-kit": "^0.31.6", "drizzle-kit": "^0.31.6",
"jsdom": "^27.2.0", "jsdom": "^27.2.0",
"tailwindcss": "^4.1.17",
"typescript": "^5.9.3", "typescript": "^5.9.3",
"vite": "^7.2.2", "vite": "^7.2.2",
"vite-tsconfig-paths": "^5.1.4",
"web-vitals": "^5.1.0" "web-vitals": "^5.1.0"
} }
}, },
@ -132,6 +132,7 @@
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz",
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@babel/code-frame": "^7.27.1", "@babel/code-frame": "^7.27.1",
"@babel/generator": "^7.28.5", "@babel/generator": "^7.28.5",
@ -801,6 +802,7 @@
} }
], ],
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
@ -844,6 +846,7 @@
} }
], ],
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=18" "node": ">=18"
} }
@ -2825,6 +2828,7 @@
"resolved": "https://registry.npmjs.org/@heroui/system/-/system-2.4.23.tgz", "resolved": "https://registry.npmjs.org/@heroui/system/-/system-2.4.23.tgz",
"integrity": "sha512-kgYvfkIOQKM6CCBIlNSE2tXMtNrS1mvEUbvwnaU3pEYbMlceBtwA5v7SlpaJy/5dqKcTbfmVMUCmXnY/Kw4vaQ==", "integrity": "sha512-kgYvfkIOQKM6CCBIlNSE2tXMtNrS1mvEUbvwnaU3pEYbMlceBtwA5v7SlpaJy/5dqKcTbfmVMUCmXnY/Kw4vaQ==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@heroui/react-utils": "2.1.14", "@heroui/react-utils": "2.1.14",
"@heroui/system-rsc": "2.3.20", "@heroui/system-rsc": "2.3.20",
@ -2910,6 +2914,7 @@
"resolved": "https://registry.npmjs.org/@heroui/theme/-/theme-2.4.23.tgz", "resolved": "https://registry.npmjs.org/@heroui/theme/-/theme-2.4.23.tgz",
"integrity": "sha512-5hoaRWG+/d/t06p7Pfhz70DUP0Uggjids7/z2Ytgup4A8KAOvDIXxvHUDlk6rRHKiN1wDMNA5H+EWsSXB/m03Q==", "integrity": "sha512-5hoaRWG+/d/t06p7Pfhz70DUP0Uggjids7/z2Ytgup4A8KAOvDIXxvHUDlk6rRHKiN1wDMNA5H+EWsSXB/m03Q==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@heroui/shared-utils": "2.1.12", "@heroui/shared-utils": "2.1.12",
"clsx": "^1.2.1", "clsx": "^1.2.1",
@ -5110,6 +5115,7 @@
"resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.81.1.tgz", "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.81.1.tgz",
"integrity": "sha512-KSdY7xb2L0DlLmlYzIOghdw/na4gsMcqJ8u4sD6tOQJr+x3hLujU9s4R8N3ob84/1bkvpvlU5PYKa1ae+OICnw==", "integrity": "sha512-KSdY7xb2L0DlLmlYzIOghdw/na4gsMcqJ8u4sD6tOQJr+x3hLujU9s4R8N3ob84/1bkvpvlU5PYKa1ae+OICnw==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@supabase/auth-js": "2.81.1", "@supabase/auth-js": "2.81.1",
"@supabase/functions-js": "2.81.1", "@supabase/functions-js": "2.81.1",
@ -5431,6 +5437,7 @@
"resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.8.tgz", "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.8.tgz",
"integrity": "sha512-4E0RP/0GJCxSNiRF2kAqE/LQkTJVlL/QNU7gIJSptaseV9HP6kOuA+N11y4bZKZxa3QopK3ZuewwutHx6DqDXQ==", "integrity": "sha512-4E0RP/0GJCxSNiRF2kAqE/LQkTJVlL/QNU7gIJSptaseV9HP6kOuA+N11y4bZKZxa3QopK3ZuewwutHx6DqDXQ==",
"license": "MIT", "license": "MIT",
"peer": true,
"funding": { "funding": {
"type": "github", "type": "github",
"url": "https://github.com/sponsors/tannerlinsley" "url": "https://github.com/sponsors/tannerlinsley"
@ -5451,6 +5458,7 @@
"resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.8.tgz", "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.8.tgz",
"integrity": "sha512-/3b9QGzkf4rE5/miL6tyhldQRlLXzMHcySOm/2Tm2OLEFE9P1ImkH0+OviDBSvyAvtAOJocar5xhd7vxdLi3aQ==", "integrity": "sha512-/3b9QGzkf4rE5/miL6tyhldQRlLXzMHcySOm/2Tm2OLEFE9P1ImkH0+OviDBSvyAvtAOJocar5xhd7vxdLi3aQ==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@tanstack/query-core": "5.90.8" "@tanstack/query-core": "5.90.8"
}, },
@ -5484,6 +5492,7 @@
"resolved": "https://registry.npmjs.org/@tanstack/react-router/-/react-router-1.135.2.tgz", "resolved": "https://registry.npmjs.org/@tanstack/react-router/-/react-router-1.135.2.tgz",
"integrity": "sha512-IzvCJ5bZ4dTEh65J1NrILF3Ab+ajRgsHYQYl/3du1sptRfQkUSsRYQGXffQQU3JH++plmO/tJXtRTmgrAp4inA==", "integrity": "sha512-IzvCJ5bZ4dTEh65J1NrILF3Ab+ajRgsHYQYl/3du1sptRfQkUSsRYQGXffQQU3JH++plmO/tJXtRTmgrAp4inA==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@tanstack/history": "1.133.28", "@tanstack/history": "1.133.28",
"@tanstack/react-store": "^0.8.0", "@tanstack/react-store": "^0.8.0",
@ -5686,6 +5695,7 @@
"resolved": "https://registry.npmjs.org/@tanstack/router-core/-/router-core-1.135.2.tgz", "resolved": "https://registry.npmjs.org/@tanstack/router-core/-/router-core-1.135.2.tgz",
"integrity": "sha512-fhJSGmbqE78Ou6e+cnJ9exmjCzCZ9IXT2rApiPAgeItKj2yy1qmTEoR11n0x0fiNkkBxHL1us+QyG8JfNELiQA==", "integrity": "sha512-fhJSGmbqE78Ou6e+cnJ9exmjCzCZ9IXT2rApiPAgeItKj2yy1qmTEoR11n0x0fiNkkBxHL1us+QyG8JfNELiQA==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@tanstack/history": "1.133.28", "@tanstack/history": "1.133.28",
"@tanstack/store": "^0.8.0", "@tanstack/store": "^0.8.0",
@ -6132,6 +6142,7 @@
"integrity": "sha512-tBFxBp9Nfyy5rsmefN+WXc1JeW/j2BpBHFdLZbEVfs9wn3E3NRFxwV0pJg8M1qQAexFpvz73hJXFofV0ZAu92A==", "integrity": "sha512-tBFxBp9Nfyy5rsmefN+WXc1JeW/j2BpBHFdLZbEVfs9wn3E3NRFxwV0pJg8M1qQAexFpvz73hJXFofV0ZAu92A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"csstype": "^3.0.2" "csstype": "^3.0.2"
} }
@ -6342,6 +6353,7 @@
} }
], ],
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"baseline-browser-mapping": "^2.8.19", "baseline-browser-mapping": "^2.8.19",
"caniuse-lite": "^1.0.30001751", "caniuse-lite": "^1.0.30001751",
@ -6593,7 +6605,8 @@
"version": "3.1.3", "version": "3.1.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
"license": "MIT" "license": "MIT",
"peer": true
}, },
"node_modules/data-urls": { "node_modules/data-urls": {
"version": "6.0.0", "version": "6.0.0",
@ -6905,6 +6918,7 @@
"integrity": "sha512-vVC0USHGtMi8+R4Kz8rt6JhEWLxsv9Rnu/lGYbPR8u47B+DCBksq9JarW0zOO7bs37hyOK1l2/oqtbciutL5+Q==", "integrity": "sha512-vVC0USHGtMi8+R4Kz8rt6JhEWLxsv9Rnu/lGYbPR8u47B+DCBksq9JarW0zOO7bs37hyOK1l2/oqtbciutL5+Q==",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"peer": true,
"bin": { "bin": {
"esbuild": "bin/esbuild" "esbuild": "bin/esbuild"
}, },
@ -7019,6 +7033,7 @@
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.23.12.tgz", "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.23.12.tgz",
"integrity": "sha512-6e78rdVtnBvlEVgu6eFEAgG9v3wLnYEboM8I5O5EXvfKC8gxGQB8wXJdhkMy10iVcn05jl6CNw7/HTsTCfwcWg==", "integrity": "sha512-6e78rdVtnBvlEVgu6eFEAgG9v3wLnYEboM8I5O5EXvfKC8gxGQB8wXJdhkMy10iVcn05jl6CNw7/HTsTCfwcWg==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"motion-dom": "^12.23.12", "motion-dom": "^12.23.12",
"motion-utils": "^12.23.6", "motion-utils": "^12.23.6",
@ -7092,6 +7107,7 @@
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==",
"dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/goober": { "node_modules/goober": {
@ -7867,6 +7883,7 @@
"resolved": "https://registry.npmjs.org/postgres/-/postgres-3.4.7.tgz", "resolved": "https://registry.npmjs.org/postgres/-/postgres-3.4.7.tgz",
"integrity": "sha512-Jtc2612XINuBjIl/QTWsV5UvE8UHuNblcO3vVADSrKsrc6RqGX6lOW1cEo3CM2v0XG4Nat8nI+YM7/f26VxXLw==", "integrity": "sha512-Jtc2612XINuBjIl/QTWsV5UvE8UHuNblcO3vVADSrKsrc6RqGX6lOW1cEo3CM2v0XG4Nat8nI+YM7/f26VxXLw==",
"license": "Unlicense", "license": "Unlicense",
"peer": true,
"engines": { "engines": {
"node": ">=12" "node": ">=12"
}, },
@ -7905,6 +7922,7 @@
"resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz",
"integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==", "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==",
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }
@ -7914,6 +7932,7 @@
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz",
"integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==", "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"scheduler": "^0.27.0" "scheduler": "^0.27.0"
}, },
@ -8097,6 +8116,7 @@
"resolved": "https://registry.npmjs.org/seroval/-/seroval-1.3.2.tgz", "resolved": "https://registry.npmjs.org/seroval/-/seroval-1.3.2.tgz",
"integrity": "sha512-RbcPH1n5cfwKrru7v7+zrZvjLurgHhGyso3HTyGtRivGWgYjbOmGuivCQaORNELjNONoK35nj28EoWul9sb1zQ==", "integrity": "sha512-RbcPH1n5cfwKrru7v7+zrZvjLurgHhGyso3HTyGtRivGWgYjbOmGuivCQaORNELjNONoK35nj28EoWul9sb1zQ==",
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=10" "node": ">=10"
} }
@ -8213,6 +8233,7 @@
"resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.3.1.tgz", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.3.1.tgz",
"integrity": "sha512-gBXpgUm/3rp1lMZZrM/w7D8GKqshif0zAymAhbCyIt8KMe+0v9DQ7cdYLR4FHH/cKpdTXb+A/tKKU3eolfsI+g==", "integrity": "sha512-gBXpgUm/3rp1lMZZrM/w7D8GKqshif0zAymAhbCyIt8KMe+0v9DQ7cdYLR4FHH/cKpdTXb+A/tKKU3eolfsI+g==",
"license": "MIT", "license": "MIT",
"peer": true,
"funding": { "funding": {
"type": "github", "type": "github",
"url": "https://github.com/sponsors/dcastil" "url": "https://github.com/sponsors/dcastil"
@ -8260,7 +8281,8 @@
"version": "1.3.3", "version": "1.3.3",
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
"integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==",
"license": "MIT" "license": "MIT",
"peer": true
}, },
"node_modules/tiny-warning": { "node_modules/tiny-warning": {
"version": "1.0.3", "version": "1.0.3",
@ -8306,6 +8328,7 @@
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=12" "node": ">=12"
}, },
@ -8375,6 +8398,7 @@
"version": "3.1.6", "version": "3.1.6",
"resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.6.tgz", "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.6.tgz",
"integrity": "sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==", "integrity": "sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==",
"dev": true,
"license": "MIT", "license": "MIT",
"bin": { "bin": {
"tsconfck": "bin/tsconfck.js" "tsconfck": "bin/tsconfck.js"
@ -8420,8 +8444,9 @@
"version": "5.9.3", "version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"devOptional": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"peer": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"
@ -8567,6 +8592,7 @@
"resolved": "https://registry.npmjs.org/vite/-/vite-7.2.2.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-7.2.2.tgz",
"integrity": "sha512-BxAKBWmIbrDgrokdGZH1IgkIk/5mMHDreLDmCJ0qpyJaAteP8NvMhkwr/ZCQNqNH97bw/dANTE9PDzqwJghfMQ==", "integrity": "sha512-BxAKBWmIbrDgrokdGZH1IgkIk/5mMHDreLDmCJ0qpyJaAteP8NvMhkwr/ZCQNqNH97bw/dANTE9PDzqwJghfMQ==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"esbuild": "^0.25.0", "esbuild": "^0.25.0",
"fdir": "^6.5.0", "fdir": "^6.5.0",
@ -8640,6 +8666,7 @@
"version": "5.1.4", "version": "5.1.4",
"resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-5.1.4.tgz", "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-5.1.4.tgz",
"integrity": "sha512-cYj0LRuLV2c2sMqhqhGpaO3LretdtMn/BVX4cPLanIZuwwrkVl+lK84E/miEXkCHWXuq65rhNN4rXsBcOB3S4w==", "integrity": "sha512-cYj0LRuLV2c2sMqhqhGpaO3LretdtMn/BVX4cPLanIZuwwrkVl+lK84E/miEXkCHWXuq65rhNN4rXsBcOB3S4w==",
"dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"debug": "^4.1.1", "debug": "^4.1.1",
@ -8677,6 +8704,7 @@
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=12" "node": ">=12"
}, },

View File

@ -1,38 +0,0 @@
import { useMutation } from "@tanstack/react-query"
import { toast } from "sonner"
import type z from "zod"
import { profileFormSchema } from "@/lib/validation/user"
import { useValidation } from "../useValidation"
type TProfileForm = z.infer<typeof profileFormSchema>
export const useProfile = () => {
const { validate, errors } = useValidation({
defaultSchema: profileFormSchema
})
const signup = useMutation({
mutationKey: ["create-profile"],
mutationFn: async (data: TProfileForm) => {},
onSuccess: () => {
toast.success("Your profile is created..", {
id: "create-profile"
})
}
})
const validateSignup = (formData: TProfileForm) => {
const isValid = validate({ formData })
if (!isValid) {
toast.error("Don't create", {
id: "create-profile"
})
}
signup.mutate(formData)
}
return {
profile: validateSignup,
errors,
isPending: signup.isPending
}
}

View File

@ -72,6 +72,7 @@ export const signupUser = createServerFn({ method: "POST" })
email: data.email, email: data.email,
password: data.password, password: data.password,
options: { options: {
// Estos son los metadatos
data: { data: {
name: data.name, name: data.name,
location: data.location location: data.location
@ -89,3 +90,5 @@ export const signupUser = createServerFn({ method: "POST" })
href: data.redirectUrl || "/" href: data.redirectUrl || "/"
}) })
}) })
// TODO: Add resend confirmation email function

View File

@ -14,7 +14,6 @@ import { Route as LogoutRouteImport } from './routes/logout'
import { Route as LoginRouteImport } from './routes/login' import { Route as LoginRouteImport } from './routes/login'
import { Route as AuthedRouteImport } from './routes/_authed' import { Route as AuthedRouteImport } from './routes/_authed'
import { Route as IndexRouteImport } from './routes/index' import { Route as IndexRouteImport } from './routes/index'
import { Route as AuthedRegisterRouteImport } from './routes/_authed/register'
import { Route as AuthedDashboardRouteImport } from './routes/_authed/dashboard' import { Route as AuthedDashboardRouteImport } from './routes/_authed/dashboard'
const SignupRoute = SignupRouteImport.update({ const SignupRoute = SignupRouteImport.update({
@ -41,11 +40,6 @@ const IndexRoute = IndexRouteImport.update({
path: '/', path: '/',
getParentRoute: () => rootRouteImport, getParentRoute: () => rootRouteImport,
} as any) } as any)
const AuthedRegisterRoute = AuthedRegisterRouteImport.update({
id: '/register',
path: '/register',
getParentRoute: () => AuthedRoute,
} as any)
const AuthedDashboardRoute = AuthedDashboardRouteImport.update({ const AuthedDashboardRoute = AuthedDashboardRouteImport.update({
id: '/dashboard', id: '/dashboard',
path: '/dashboard', path: '/dashboard',
@ -58,7 +52,6 @@ export interface FileRoutesByFullPath {
'/logout': typeof LogoutRoute '/logout': typeof LogoutRoute
'/signup': typeof SignupRoute '/signup': typeof SignupRoute
'/dashboard': typeof AuthedDashboardRoute '/dashboard': typeof AuthedDashboardRoute
'/register': typeof AuthedRegisterRoute
} }
export interface FileRoutesByTo { export interface FileRoutesByTo {
'/': typeof IndexRoute '/': typeof IndexRoute
@ -66,7 +59,6 @@ export interface FileRoutesByTo {
'/logout': typeof LogoutRoute '/logout': typeof LogoutRoute
'/signup': typeof SignupRoute '/signup': typeof SignupRoute
'/dashboard': typeof AuthedDashboardRoute '/dashboard': typeof AuthedDashboardRoute
'/register': typeof AuthedRegisterRoute
} }
export interface FileRoutesById { export interface FileRoutesById {
__root__: typeof rootRouteImport __root__: typeof rootRouteImport
@ -76,13 +68,12 @@ export interface FileRoutesById {
'/logout': typeof LogoutRoute '/logout': typeof LogoutRoute
'/signup': typeof SignupRoute '/signup': typeof SignupRoute
'/_authed/dashboard': typeof AuthedDashboardRoute '/_authed/dashboard': typeof AuthedDashboardRoute
'/_authed/register': typeof AuthedRegisterRoute
} }
export interface FileRouteTypes { export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/' | '/login' | '/logout' | '/signup' | '/dashboard' | '/register' fullPaths: '/' | '/login' | '/logout' | '/signup' | '/dashboard'
fileRoutesByTo: FileRoutesByTo fileRoutesByTo: FileRoutesByTo
to: '/' | '/login' | '/logout' | '/signup' | '/dashboard' | '/register' to: '/' | '/login' | '/logout' | '/signup' | '/dashboard'
id: id:
| '__root__' | '__root__'
| '/' | '/'
@ -91,7 +82,6 @@ export interface FileRouteTypes {
| '/logout' | '/logout'
| '/signup' | '/signup'
| '/_authed/dashboard' | '/_authed/dashboard'
| '/_authed/register'
fileRoutesById: FileRoutesById fileRoutesById: FileRoutesById
} }
export interface RootRouteChildren { export interface RootRouteChildren {
@ -139,13 +129,6 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof IndexRouteImport preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport parentRoute: typeof rootRouteImport
} }
'/_authed/register': {
id: '/_authed/register'
path: '/register'
fullPath: '/register'
preLoaderRoute: typeof AuthedRegisterRouteImport
parentRoute: typeof AuthedRoute
}
'/_authed/dashboard': { '/_authed/dashboard': {
id: '/_authed/dashboard' id: '/_authed/dashboard'
path: '/dashboard' path: '/dashboard'
@ -158,12 +141,10 @@ declare module '@tanstack/react-router' {
interface AuthedRouteChildren { interface AuthedRouteChildren {
AuthedDashboardRoute: typeof AuthedDashboardRoute AuthedDashboardRoute: typeof AuthedDashboardRoute
AuthedRegisterRoute: typeof AuthedRegisterRoute
} }
const AuthedRouteChildren: AuthedRouteChildren = { const AuthedRouteChildren: AuthedRouteChildren = {
AuthedDashboardRoute: AuthedDashboardRoute, AuthedDashboardRoute: AuthedDashboardRoute,
AuthedRegisterRoute: AuthedRegisterRoute,
} }
const AuthedRouteWithChildren = const AuthedRouteWithChildren =

View File

@ -1,42 +0,0 @@
import { Button, Form, Input, Slider, Textarea } from "@heroui/react"
import { createFileRoute } from "@tanstack/react-router"
import type { FormEvent } from "react"
import { useProfile } from "@/lib/hooks/user/useCreateUser"
export const Route = createFileRoute("/_authed/register")({
component: RouteComponent
})
function RouteComponent() {
const { errors, isPending, profile } = useProfile()
const handleSubmit = (e: FormEvent<HTMLFormElement>) => {
e.preventDefault()
const formData = new FormData(e.currentTarget)
profile({
id: "e6472b9d-01a9-4e2e-8bdc-0ddaa9baf5d8",
firstName: formData.get("firstName") as string,
lastName: formData.get("lastName") as string
})
}
return (
<div>
<Form
className="grid gap-2 max-w-sm w-full"
onSubmit={handleSubmit}
validationErrors={errors}
>
<Input name="name" label="Nombre completo" isRequired />
<Input name="company" label="Empresa" />
<Input name="role" label="Cargo" />
<Textarea name="description" label="Descripción" />
<Textarea name="differentiator" label="¿Qué te hace diferente?" />
<Slider name="coverage_areas" label="Areas de cobertura" />
<Input name="services" label="Servicios" />
{/* Crear varios checkboxes */}
<Button isLoading={isPending} type="submit">
Crear usuario
</Button>
</Form>
</div>
)
}