Refactor Stripe payment handling and order status
Refactored Stripe payment integration to use a dedicated Stripe model for session data, updating the PaymentSerializer accordingly. Renamed Order.Status to Order.OrderStatus for clarity. Updated configuration app to ensure SiteConfiguration singleton is created post-migration. Removed obsolete seed_app_config command from docker-compose. Adjusted frontend API generated files and moved orval config.
This commit is contained in:
330
frontend/package-lock.json
generated
330
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@
|
||||
"build": "tsc -b && tsc -b && vite build",
|
||||
"lint": "eslint .",
|
||||
"preview": "vite preview",
|
||||
"api:gen": "orval --config orval.config.ts"
|
||||
"api:gen": "orval --config src/orval.config.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/vite": "^4.1.16",
|
||||
@@ -16,7 +16,6 @@
|
||||
"@types/react-router": "^5.1.20",
|
||||
"axios": "^1.13.0",
|
||||
"dotenv": "^17.2.3",
|
||||
"orval": "^7.13.2",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"react-icons": "^5.5.0",
|
||||
@@ -26,8 +25,7 @@
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.33.0",
|
||||
"@tailwindcss/postcss": "^4.1.17",
|
||||
"@types/axios": "^0.9.36",
|
||||
"@types/node": "^24.10.1",
|
||||
"@types/node": "^24.10.4",
|
||||
"@types/react": "^19.1.10",
|
||||
"@types/react-dom": "^19.1.7",
|
||||
"@vitejs/plugin-react": "^5.0.0",
|
||||
@@ -36,6 +34,7 @@
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.20",
|
||||
"globals": "^16.3.0",
|
||||
"orval": "^7.13.2",
|
||||
"typescript": "~5.8.3",
|
||||
"typescript-eslint": "^8.39.1",
|
||||
"vite": "^7.1.2"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
v tehle složce se vygeneruje schema
|
||||
1
frontend/src/api/generated/private/models/filler
Normal file
1
frontend/src/api/generated/private/models/filler
Normal file
@@ -0,0 +1 @@
|
||||
filler
|
||||
@@ -1,4 +1,4 @@
|
||||
import axios from "axios";
|
||||
import axios, { type AxiosRequestConfig } from "axios";
|
||||
|
||||
// použij tohle pro API vyžadující autentizaci
|
||||
export const privateApi = axios.create({
|
||||
@@ -25,3 +25,11 @@ privateApi.interceptors.response.use(
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
export const privateMutator = async <T>(
|
||||
config: AxiosRequestConfig
|
||||
): Promise<T> => {
|
||||
const response = await privateApi.request<T>(config);
|
||||
return response.data;
|
||||
};
|
||||
@@ -1,7 +1,16 @@
|
||||
import axios from "axios";
|
||||
import axios, { type AxiosRequestConfig } from "axios";
|
||||
|
||||
// použij tohle pro veřejné API nevyžadující autentizaci
|
||||
export const publicApi = axios.create({
|
||||
baseURL: "/api/",
|
||||
withCredentials: false, // veřejné API NEPOSÍLÁ cookies
|
||||
});
|
||||
|
||||
|
||||
// ⬇⬇⬇ TOHLE JE TEN MUTATOR ⬇⬇⬇
|
||||
export const publicMutator = async <T>(
|
||||
config: AxiosRequestConfig
|
||||
): Promise<T> => {
|
||||
const response = await publicApi.request<T>(config);
|
||||
return response.data;
|
||||
};
|
||||
@@ -1,8 +1,7 @@
|
||||
import { defineConfig } from "orval";
|
||||
import "dotenv/config";
|
||||
import {process} from "node:process";
|
||||
|
||||
const backendUrl = process.env.VITE_API_BASE_URL || "http://localhost:8000";
|
||||
const backendUrl = process.env.VITE_BACKEND_URL || "http://localhost:8000";
|
||||
|
||||
// může se hodit pokud nechceme při buildu generovat klienta (nechat false pro produkci nebo vynechat)
|
||||
const SKIP_ORVAL = process.env.SKIP_ORVAL === "true";
|
||||
@@ -23,8 +22,8 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
output: {
|
||||
target: "src/api/generated/public.ts",
|
||||
schemas: "src/api/generated/public/models",
|
||||
target: "api/generated/public.ts",
|
||||
schemas: "api/generated/public/models",
|
||||
|
||||
mode: "tags",
|
||||
clean: true,
|
||||
@@ -34,8 +33,8 @@ export default defineConfig({
|
||||
|
||||
override: {
|
||||
mutator: {
|
||||
path: "src/api/publicClient.ts", //IMPORTANTE
|
||||
name: "publicApi",
|
||||
path: "api/publicClient.ts", //IMPORTANTE
|
||||
name: "publicMutator",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -45,13 +44,11 @@ export default defineConfig({
|
||||
},
|
||||
private: {
|
||||
input: {
|
||||
target: `${backendUrl}/api/schema/`
|
||||
|
||||
// No filters, include all endpoints
|
||||
target: `${backendUrl}/api/schema/`,
|
||||
},
|
||||
output: {
|
||||
target: "src/api/generated/private.ts", //IMPORTANTE
|
||||
schemas: "src/api/generated/private/models",
|
||||
target: "api/generated/private.ts", //IMPORTANTE
|
||||
schemas: "api/generated/private/models",
|
||||
|
||||
mode: "tags",
|
||||
clean: true,
|
||||
@@ -61,8 +58,8 @@ export default defineConfig({
|
||||
|
||||
override: {
|
||||
mutator: {
|
||||
path: "src/api/privateClient.ts",
|
||||
name: "privateApi",
|
||||
path: "api/privateClient.ts",
|
||||
name: "privateMutator",
|
||||
},
|
||||
},
|
||||
},
|
||||
Reference in New Issue
Block a user