Skip to content

Commit

Permalink
Merge pull request #124 from CETEN-OpenBar/fix/accountpricestaffbar
Browse files Browse the repository at this point in the history
fix(price): the price for staff was inverse with privilegier
  • Loading branch information
aripot007 authored Nov 6, 2024
2 parents dbb60de + 6c4aca2 commit 9621948
Show file tree
Hide file tree
Showing 8 changed files with 793 additions and 582 deletions.
266 changes: 133 additions & 133 deletions backend/autogen/bar.gen.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bar.openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4806,8 +4806,8 @@ components:
example: student
enum:
- coutant
- privilegies
- staff_bar
- privilegies
- menu
- ceten
- externe
Expand Down
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
gofumpt

go-task

openapi-generator-cli
];
shellHook = "";
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/api/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.6.0
7.8.0
1,072 changes: 629 additions & 443 deletions frontend/src/lib/api/api.ts

Large diffs are not rendered by default.

20 changes: 17 additions & 3 deletions frontend/src/lib/api/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import type { Configuration } from './configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';

export const BASE_PATH = "http://localhost:8080".replace(/\/+$/, "");
Expand All @@ -39,7 +39,7 @@ export const COLLECTION_FORMATS = {
*/
export interface RequestArgs {
url: string;
options: AxiosRequestConfig;
options: RawAxiosRequestConfig;
}

/**
Expand All @@ -53,7 +53,7 @@ export class BaseAPI {
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
if (configuration) {
this.configuration = configuration;
this.basePath = configuration.basePath || this.basePath;
this.basePath = configuration.basePath ?? basePath;
}
}
};
Expand All @@ -70,3 +70,17 @@ export class RequiredError extends Error {
this.name = "RequiredError"
}
}

interface ServerMap {
[key: string]: {
url: string,
description: string,
}[];
}

/**
*
* @export
*/
export const operationServerMap: ServerMap = {
}
2 changes: 1 addition & 1 deletion frontend/src/lib/api/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const toPathString = function (url: URL) {
*/
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url};
const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
return axios.request<T, R>(axiosRequestArgs);
};
}
9 changes: 9 additions & 0 deletions frontend/src/lib/api/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface ConfigurationParameters {
password?: string;
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
basePath?: string;
serverIndex?: number;
baseOptions?: any;
formDataCtor?: new () => any;
}
Expand Down Expand Up @@ -58,6 +59,13 @@ export class Configuration {
* @memberof Configuration
*/
basePath?: string;
/**
* override server index
*
* @type {number}
* @memberof Configuration
*/
serverIndex?: number;
/**
* base options for axios calls
*
Expand All @@ -80,6 +88,7 @@ export class Configuration {
this.password = param.password;
this.accessToken = param.accessToken;
this.basePath = param.basePath;
this.serverIndex = param.serverIndex;
this.baseOptions = param.baseOptions;
this.formDataCtor = param.formDataCtor;
}
Expand Down

0 comments on commit 9621948

Please sign in to comment.