Skip to content

Commit

Permalink
Merge pull request #107 from bas-kirill/feature/render-images
Browse files Browse the repository at this point in the history
feat(client): render images
  • Loading branch information
bas-kirill authored Aug 24, 2024
2 parents 2939f9a + f41480a commit 8bf6a7c
Show file tree
Hide file tree
Showing 73 changed files with 1,234 additions and 511 deletions.
7 changes: 7 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"axios": "^1.7.2",
"js-base64": "^3.7.7",
"jwt-decode": "^4.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
3 changes: 3 additions & 0 deletions client/src/generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ api/edit-instrument-api.ts
api/get-countries-api.ts
api/get-instrument-basic-materials-api.ts
api/get-instrument-by-id-api.ts
api/get-instrument-photo-api.ts
api/get-instrument-types-api.ts
api/get-instruments-by-criteria-api.ts
api/get-instruments-by-criteria-paginated-api.ts
Expand All @@ -35,9 +36,11 @@ model/get-instruments-by-criteria-request-body.ts
model/get-instruments-by-criteria-response.ts
model/get-manufacturers-response.ts
model/index.ts
model/instrument-detail-without-id.ts
model/instrument-detail.ts
model/instrument-id.ts
model/instrument-name.ts
model/instrument-photo.ts
model/instrument-type.ts
model/jwt-response.ts
model/list-favorite-response-body.ts
Expand Down
1 change: 1 addition & 0 deletions client/src/generated/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export * from "./api/edit-instrument-api";
export * from "./api/get-countries-api";
export * from "./api/get-instrument-basic-materials-api";
export * from "./api/get-instrument-by-id-api";
export * from "./api/get-instrument-photo-api";
export * from "./api/get-instrument-types-api";
export * from "./api/get-instruments-by-criteria-api";
export * from "./api/get-instruments-by-criteria-paginated-api";
Expand Down
203 changes: 203 additions & 0 deletions client/src/generated/api/get-instrument-photo-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
/* tslint:disable */
/* eslint-disable */
/**
* Country
* Basic Material
*
* The version of the OpenAPI document: 1.0.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import type { Configuration } from "../configuration";
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios";
import globalAxios from "axios";
// Some imports not used depending on template conditions
// @ts-ignore
import {
DUMMY_BASE_URL,
assertParamExists,
setApiKeyToObject,
setBasicAuthToObject,
setBearerAuthToObject,
setOAuthToObject,
setSearchParams,
serializeDataIfNeeded,
toPathString,
createRequestFunction,
} from "../common";
// @ts-ignore
import {
BASE_PATH,
COLLECTION_FORMATS,
type RequestArgs,
BaseAPI,
RequiredError,
operationServerMap,
} from "../base";
// @ts-ignore
import type { ClientError } from "../model";
// @ts-ignore
import type { InstrumentPhoto } from "../model";
// @ts-ignore
import type { ServerError } from "../model";
/**
* GetInstrumentPhotoApi - axios parameter creator
* @export
*/
export const GetInstrumentPhotoApiAxiosParamCreator = function (
configuration?: Configuration,
) {
return {
/**
* Get Instrument Photo
* @summary Get Instrument Photo
* @param {number} instrumentId Instrument ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInstrumentPhoto: async (
instrumentId: number,
options: RawAxiosRequestConfig = {},
): Promise<RequestArgs> => {
// verify required parameter 'instrumentId' is not null or undefined
assertParamExists("getInstrumentPhoto", "instrumentId", instrumentId);
const localVarPath = `/api/instrument/photo/{instrumentId}`.replace(
`{${"instrumentId"}}`,
encodeURIComponent(String(instrumentId)),
);
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = {
method: "GET",
...baseOptions,
...options,
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};

/**
* GetInstrumentPhotoApi - functional programming interface
* @export
*/
export const GetInstrumentPhotoApiFp = function (
configuration?: Configuration,
) {
const localVarAxiosParamCreator =
GetInstrumentPhotoApiAxiosParamCreator(configuration);
return {
/**
* Get Instrument Photo
* @summary Get Instrument Photo
* @param {number} instrumentId Instrument ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getInstrumentPhoto(
instrumentId: number,
options?: RawAxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise<InstrumentPhoto>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.getInstrumentPhoto(
instrumentId,
options,
);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath =
operationServerMap["GetInstrumentPhotoApi.getInstrumentPhoto"]?.[
localVarOperationServerIndex
]?.url;
return (axios, basePath) =>
createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration,
)(axios, localVarOperationServerBasePath || basePath);
},
};
};

/**
* GetInstrumentPhotoApi - factory interface
* @export
*/
export const GetInstrumentPhotoApiFactory = function (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance,
) {
const localVarFp = GetInstrumentPhotoApiFp(configuration);
return {
/**
* Get Instrument Photo
* @summary Get Instrument Photo
* @param {number} instrumentId Instrument ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInstrumentPhoto(
instrumentId: number,
options?: RawAxiosRequestConfig,
): AxiosPromise<InstrumentPhoto> {
return localVarFp
.getInstrumentPhoto(instrumentId, options)
.then((request) => request(axios, basePath));
},
};
};

/**
* GetInstrumentPhotoApi - object-oriented interface
* @export
* @class GetInstrumentPhotoApi
* @extends {BaseAPI}
*/
export class GetInstrumentPhotoApi extends BaseAPI {
/**
* Get Instrument Photo
* @summary Get Instrument Photo
* @param {number} instrumentId Instrument ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof GetInstrumentPhotoApi
*/
public getInstrumentPhoto(
instrumentId: number,
options?: RawAxiosRequestConfig,
) {
return GetInstrumentPhotoApiFp(this.configuration)
.getInstrumentPhoto(instrumentId, options)
.then((request) => request(this.axios, this.basePath));
}
}
57 changes: 6 additions & 51 deletions client/src/generated/model/create-instrument-request-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,10 @@

// May contain unused imports in some cases
// @ts-ignore
import type { BasicMaterial } from "./basic-material";
import type { InstrumentDetailWithoutId } from "./instrument-detail-without-id";
// May contain unused imports in some cases
// @ts-ignore
import type { Country } from "./country";
// May contain unused imports in some cases
// @ts-ignore
import type { InstrumentName } from "./instrument-name";
// May contain unused imports in some cases
// @ts-ignore
import type { InstrumentType } from "./instrument-type";
// May contain unused imports in some cases
// @ts-ignore
import type { ManufactureDate } from "./manufacture-date";
// May contain unused imports in some cases
// @ts-ignore
import type { ManufacturerName } from "./manufacturer-name";
// May contain unused imports in some cases
// @ts-ignore
import type { ReleaseDate } from "./release-date";
import type { InstrumentPhoto } from "./instrument-photo";

/**
*
Expand All @@ -42,44 +27,14 @@ import type { ReleaseDate } from "./release-date";
export interface CreateInstrumentRequestBody {
/**
*
* @type {InstrumentName}
* @memberof CreateInstrumentRequestBody
*/
instrument_name: InstrumentName;
/**
*
* @type {InstrumentType}
* @memberof CreateInstrumentRequestBody
*/
instrument_type: InstrumentType;
/**
*
* @type {ManufacturerName}
* @memberof CreateInstrumentRequestBody
*/
manufacturer_name: ManufacturerName;
/**
*
* @type {ManufactureDate}
* @memberof CreateInstrumentRequestBody
*/
manufacturer_date: ManufactureDate;
/**
*
* @type {ReleaseDate}
* @memberof CreateInstrumentRequestBody
*/
release_date: ReleaseDate;
/**
*
* @type {Country}
* @type {InstrumentDetailWithoutId}
* @memberof CreateInstrumentRequestBody
*/
country: Country;
instrument_detail: InstrumentDetailWithoutId;
/**
*
* @type {Array<BasicMaterial>}
* @type {InstrumentPhoto}
* @memberof CreateInstrumentRequestBody
*/
materials: Array<BasicMaterial>;
instrument_photo: InstrumentPhoto;
}
Loading

0 comments on commit 8bf6a7c

Please sign in to comment.