Added settings
This commit is contained in:
Generated
+16
@@ -17,6 +17,7 @@
|
||||
"@openapitools/openapi-generator-cli": "^2.25.2",
|
||||
"@tailwindcss/postcss": "^4.1.17",
|
||||
"@tailwindcss/vite": "^4.1.17",
|
||||
"browser-image-compression": "^2.0.2",
|
||||
"ng-zorro-antd": "^20.4.0",
|
||||
"postcss": "^8.5.6",
|
||||
"rxjs": "~7.8.0",
|
||||
@@ -4432,6 +4433,15 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/browser-image-compression": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/browser-image-compression/-/browser-image-compression-2.0.2.tgz",
|
||||
"integrity": "sha512-pBLlQyUf6yB8SmmngrcOw3EoS4RpQ1BcylI3T9Yqn7+4nrQTXJD4sJDe5ODnJdrvNMaio5OicFo75rDyJD2Ucw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"uzip": "0.20201231.0"
|
||||
}
|
||||
},
|
||||
"node_modules/browserslist": {
|
||||
"version": "4.28.0",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.0.tgz",
|
||||
@@ -9962,6 +9972,12 @@
|
||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/uzip": {
|
||||
"version": "0.20201231.0",
|
||||
"resolved": "https://registry.npmjs.org/uzip/-/uzip-0.20201231.0.tgz",
|
||||
"integrity": "sha512-OZeJfZP+R0z9D6TmBgLq2LHzSSptGMGDGigGiEe0pr8UBe/7fdflgHlHBNDASTXB5jnFuxHpNaJywSg8YFeGng==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/validate-npm-package-license": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
"@openapitools/openapi-generator-cli": "^2.25.2",
|
||||
"@tailwindcss/postcss": "^4.1.17",
|
||||
"@tailwindcss/vite": "^4.1.17",
|
||||
"browser-image-compression": "^2.0.2",
|
||||
"ng-zorro-antd": "^20.4.0",
|
||||
"postcss": "^8.5.6",
|
||||
"rxjs": "~7.8.0",
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
<form nz-form nzLayout="horizontal" [formGroup]="settingForm" (ngSubmit)="submitForm()">
|
||||
<form nz-form nzLayout="horizontal" [formGroup]="settingForm">
|
||||
|
||||
<!-- Logo -->
|
||||
<div class="row">
|
||||
<div class="row-left">
|
||||
<img [src]="setting.logo" alt="logo">
|
||||
@if (settings().logo) {
|
||||
<img [src]="'data:image/jpeg;base64,' + settings().logo" alt=""/>
|
||||
} @else {
|
||||
<img [src]="setting.logo" alt="logo">
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="row-right">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzSpan="9">Logo</nz-form-label>
|
||||
<nz-form-control nzSpan="25">
|
||||
<input nz-input type="file" formControlName="logo"/>
|
||||
<nz-form-control nzErrorTip="Ce champ est requis">
|
||||
<input #fileInputLogo nz-input type="file" placeholder="Déposer"
|
||||
(change)="onFileChange('logo', fileInputLogo.files)">
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -19,17 +24,21 @@
|
||||
<!-- Signature -->
|
||||
<div class="row">
|
||||
<div class="row-left">
|
||||
<img [src]="setting.signature" alt="logo">
|
||||
@if (settings().electronicSignature) {
|
||||
<img [src]="'data:image/jpeg;base64,' + settings().electronicSignature" alt=""/>
|
||||
} @else {
|
||||
<img [src]="setting.electronicSignature" alt="logo">
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="row-right">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzSpan="9">Signature</nz-form-label>
|
||||
<nz-form-control nzSpan="25">
|
||||
<input nz-input type="file" formControlName="signature"/>
|
||||
<nz-form-control nzErrorTip="Ce champ est requis">
|
||||
<input #fileInputSignature nz-input type="file" placeholder="Déposer"
|
||||
(change)="onFileChange('electronicSignature', fileInputSignature.files)">
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {Component, inject, OnInit, signal} from '@angular/core';
|
||||
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from "@angular/forms";
|
||||
import {NzColDirective} from "ng-zorro-antd/grid";
|
||||
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
|
||||
import {NzInputDirective} from "ng-zorro-antd/input";
|
||||
import {SettingInfo} from "../../interfaces/setting.interface";
|
||||
import {firstValueFrom} from "rxjs";
|
||||
import {GetSettingDto, SettingsService} from "../../services/api";
|
||||
import {NzNotificationService} from "ng-zorro-antd/notification";
|
||||
import imageCompression from "browser-image-compression";
|
||||
|
||||
@Component({
|
||||
selector: 'app-setting-form',
|
||||
@@ -15,30 +19,68 @@ import {SettingInfo} from "../../interfaces/setting.interface";
|
||||
NzFormItemComponent,
|
||||
NzFormLabelComponent,
|
||||
NzInputDirective,
|
||||
ReactiveFormsModule
|
||||
ReactiveFormsModule,
|
||||
],
|
||||
templateUrl: './setting-form.html',
|
||||
styleUrl: './setting-form.css',
|
||||
})
|
||||
export class SettingForm {
|
||||
settingForm: FormGroup = new FormGroup({
|
||||
logo: new FormControl<string>(null),
|
||||
signature: new FormControl<string>(null)
|
||||
})
|
||||
export class SettingForm implements OnInit {
|
||||
private settingsService = inject(SettingsService);
|
||||
private notificationService = inject(NzNotificationService);
|
||||
|
||||
submitForm() {
|
||||
// Pour annuler si le formulaire est invalide
|
||||
if (this.settingForm.invalid) return;
|
||||
|
||||
// Pour obtenir la valeur du formulaire
|
||||
console.log(this.settingForm.getRawValue())
|
||||
|
||||
// Pour vider le formulaire
|
||||
this.settingForm.reset()
|
||||
}
|
||||
settings = signal<GetSettingDto>({});
|
||||
|
||||
setting: SettingInfo = {
|
||||
logo: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png',
|
||||
signature: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png'
|
||||
electronicSignature: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png'
|
||||
}
|
||||
|
||||
settingForm: FormGroup = new FormGroup({
|
||||
logo: new FormControl<string>(null),
|
||||
electronicSignature: new FormControl<string>(null)
|
||||
})
|
||||
|
||||
async ngOnInit() {
|
||||
await this.fetchSettings();
|
||||
}
|
||||
|
||||
async fetchSettings() {
|
||||
try {
|
||||
const settingsPicture = await firstValueFrom(this.settingsService.getSettingEndpoint());
|
||||
this.settings.set(settingsPicture);
|
||||
} catch {
|
||||
this.notificationService.error(
|
||||
'Erreur',
|
||||
'Aucun paramètre défini'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
async onFileChange(control: string, files?: FileList | null) {
|
||||
if (!files?.length) return;
|
||||
|
||||
const file = files[0];
|
||||
|
||||
const options = {
|
||||
maxSizeMB: 1,
|
||||
maxWidthOrHeight: 1080,
|
||||
useWebWorker: true,
|
||||
fileType: 'image/jpeg'
|
||||
}
|
||||
|
||||
const compressed = await imageCompression(file, options);
|
||||
|
||||
try {
|
||||
if (control === 'logo') {
|
||||
await firstValueFrom(this.settingsService.patchSettingLogoEndpoint(compressed));
|
||||
} else {
|
||||
await firstValueFrom(this.settingsService.patchSettingElectronicSignatureEndpoint(compressed));
|
||||
}
|
||||
await this.fetchSettings();
|
||||
} catch {
|
||||
this.notificationService.error('Erreur', "Erreur de communication avec l'API");
|
||||
}
|
||||
|
||||
this.settingForm.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface SettingInfo {
|
||||
logo: string;
|
||||
signature: string;
|
||||
electronicSignature: string;
|
||||
}
|
||||
@@ -28,7 +28,6 @@ model/create-purchase-order-dto.ts
|
||||
model/create-purchase-order-product-dto.ts
|
||||
model/create-purchase-product-dto.ts
|
||||
model/create-quotation-dto.ts
|
||||
model/create-setting-dto.ts
|
||||
model/create-supplier-dto.ts
|
||||
model/create-user-dto.ts
|
||||
model/get-deliverer-dto.ts
|
||||
@@ -55,8 +54,6 @@ model/patch-purchase-product-quantity-dto.ts
|
||||
model/patch-quotation-conditions-sale-dto.ts
|
||||
model/patch-quotation-message-dto.ts
|
||||
model/patch-quotation-product-quantity-dto.ts
|
||||
model/patch-setting-electronic-signature-dto.ts
|
||||
model/patch-setting-logo-dto.ts
|
||||
model/patch-supplier-delivery-delay-dto.ts
|
||||
model/patch-user-password-dto.ts
|
||||
model/patch-ware-house-product-quantity-dto.ts
|
||||
|
||||
@@ -17,14 +17,8 @@ import {
|
||||
import {CustomHttpParameterCodec} from '../encoder';
|
||||
import {Observable} from 'rxjs';
|
||||
|
||||
// @ts-ignore
|
||||
import {CreateSettingDto} from '../model/create-setting-dto';
|
||||
// @ts-ignore
|
||||
import {GetSettingDto} from '../model/get-setting-dto';
|
||||
// @ts-ignore
|
||||
import {PatchSettingElectronicSignatureDto} from '../model/patch-setting-electronic-signature-dto';
|
||||
// @ts-ignore
|
||||
import {PatchSettingLogoDto} from '../model/patch-setting-logo-dto';
|
||||
|
||||
// @ts-ignore
|
||||
import {BASE_PATH, COLLECTION_FORMATS} from '../variables';
|
||||
@@ -42,188 +36,30 @@ export class SettingsService extends BaseService {
|
||||
}
|
||||
|
||||
/**
|
||||
* @endpoint post /API/settings
|
||||
* @param createSettingDto
|
||||
* @endpoint get /API/settings
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'body', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<any>;
|
||||
public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'response', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<HttpResponse<any>>;
|
||||
public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'events', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<HttpEvent<any>>;
|
||||
public createSettingEndpoint(createSettingDto: CreateSettingDto, observe: any = 'body', reportProgress: boolean = false, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<any> {
|
||||
if (createSettingDto === null || createSettingDto === undefined) {
|
||||
throw new Error('Required parameter createSettingDto was null or undefined when calling createSettingEndpoint.');
|
||||
}
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
|
||||
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [
|
||||
'application/json'
|
||||
];
|
||||
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
||||
if (httpContentTypeSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
||||
}
|
||||
|
||||
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||
if (localVarHttpHeaderAcceptSelected) {
|
||||
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
||||
responseType_ = 'text';
|
||||
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
||||
responseType_ = 'json';
|
||||
} else {
|
||||
responseType_ = 'blob';
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/API/settings`;
|
||||
const {basePath, withCredentials} = this.configuration;
|
||||
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: createSettingDto,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? {withCredentials} : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @endpoint delete /API/settings/{id}
|
||||
* @param id
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public deleteSettingEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<any>;
|
||||
public deleteSettingEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<HttpResponse<any>>;
|
||||
public deleteSettingEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<HttpEvent<any>>;
|
||||
public deleteSettingEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<any> {
|
||||
if (id === null || id === undefined) {
|
||||
throw new Error('Required parameter id was null or undefined when calling deleteSettingEndpoint.');
|
||||
}
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
|
||||
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
|
||||
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||
if (localVarHttpHeaderAcceptSelected) {
|
||||
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
||||
responseType_ = 'text';
|
||||
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
||||
responseType_ = 'json';
|
||||
} else {
|
||||
responseType_ = 'blob';
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/API/settings/${this.configuration.encodeParam({
|
||||
name: "id",
|
||||
value: id,
|
||||
in: "path",
|
||||
style: "simple",
|
||||
explode: false,
|
||||
dataType: "number",
|
||||
dataFormat: "int32"
|
||||
})}`;
|
||||
const {basePath, withCredentials} = this.configuration;
|
||||
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? {withCredentials} : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @endpoint get /API/settings/{id}
|
||||
* @param id
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public getSettingEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {
|
||||
public getSettingEndpoint(observe?: 'body', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: 'application/json',
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<GetSettingDto>;
|
||||
public getSettingEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
|
||||
public getSettingEndpoint(observe?: 'response', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: 'application/json',
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<HttpResponse<GetSettingDto>>;
|
||||
public getSettingEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
|
||||
public getSettingEndpoint(observe?: 'events', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: 'application/json',
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<HttpEvent<GetSettingDto>>;
|
||||
public getSettingEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
|
||||
public getSettingEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {
|
||||
httpHeaderAccept?: 'application/json',
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<any> {
|
||||
if (id === null || id === undefined) {
|
||||
throw new Error('Required parameter id was null or undefined when calling getSettingEndpoint.');
|
||||
}
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
@@ -250,15 +86,7 @@ export class SettingsService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/API/settings/${this.configuration.encodeParam({
|
||||
name: "id",
|
||||
value: id,
|
||||
in: "path",
|
||||
style: "simple",
|
||||
explode: false,
|
||||
dataType: "number",
|
||||
dataFormat: "int32"
|
||||
})}`;
|
||||
let localVarPath = `/API/settings`;
|
||||
const {basePath, withCredentials} = this.configuration;
|
||||
return this.httpClient.request<GetSettingDto>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
@@ -274,38 +102,31 @@ export class SettingsService extends BaseService {
|
||||
}
|
||||
|
||||
/**
|
||||
* @endpoint patch /API/settings/{id}/ElectronicSignature
|
||||
* @param id
|
||||
* @param patchSettingElectronicSignatureDto
|
||||
* @endpoint patch /API/settings/electronicSignature
|
||||
* @param electronicSignature
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'body', reportProgress?: boolean, options?: {
|
||||
public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'body', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<any>;
|
||||
public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'response', reportProgress?: boolean, options?: {
|
||||
public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'response', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<HttpResponse<any>>;
|
||||
public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'events', reportProgress?: boolean, options?: {
|
||||
public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'events', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<HttpEvent<any>>;
|
||||
public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe: any = 'body', reportProgress: boolean = false, options?: {
|
||||
public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<any> {
|
||||
if (id === null || id === undefined) {
|
||||
throw new Error('Required parameter id was null or undefined when calling patchSettingElectronicSignatureEndpoint.');
|
||||
}
|
||||
if (patchSettingElectronicSignatureDto === null || patchSettingElectronicSignatureDto === undefined) {
|
||||
throw new Error('Required parameter patchSettingElectronicSignatureDto was null or undefined when calling patchSettingElectronicSignatureEndpoint.');
|
||||
}
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
@@ -318,14 +139,27 @@ export class SettingsService extends BaseService {
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [
|
||||
'application/json'
|
||||
'multipart/form-data'
|
||||
];
|
||||
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
||||
if (httpContentTypeSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
||||
|
||||
const canConsumeForm = this.canConsumeForm(consumes);
|
||||
|
||||
let localVarFormParams: { append(param: string, value: any): any; };
|
||||
let localVarUseForm = false;
|
||||
let localVarConvertFormParamsToString = false;
|
||||
// use FormData to transmit files using content-type "multipart/form-data"
|
||||
// see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
|
||||
localVarUseForm = canConsumeForm;
|
||||
if (localVarUseForm) {
|
||||
localVarFormParams = new FormData();
|
||||
} else {
|
||||
localVarFormParams = new HttpParams({encoder: this.encoder});
|
||||
}
|
||||
|
||||
if (electronicSignature !== undefined) {
|
||||
localVarFormParams = localVarFormParams.append('electronicSignature', <any>electronicSignature) as any || localVarFormParams;
|
||||
}
|
||||
|
||||
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||
@@ -339,20 +173,12 @@ export class SettingsService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/API/settings/${this.configuration.encodeParam({
|
||||
name: "id",
|
||||
value: id,
|
||||
in: "path",
|
||||
style: "simple",
|
||||
explode: false,
|
||||
dataType: "number",
|
||||
dataFormat: "int32"
|
||||
})}/ElectronicSignature`;
|
||||
let localVarPath = `/API/settings/electronicSignature`;
|
||||
const {basePath, withCredentials} = this.configuration;
|
||||
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: patchSettingElectronicSignatureDto,
|
||||
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? {withCredentials} : {}),
|
||||
headers: localVarHeaders,
|
||||
@@ -364,38 +190,31 @@ export class SettingsService extends BaseService {
|
||||
}
|
||||
|
||||
/**
|
||||
* @endpoint patch /API/settings/{id}/logo
|
||||
* @param id
|
||||
* @param patchSettingLogoDto
|
||||
* @endpoint patch /API/settings/logo
|
||||
* @param logo
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'body', reportProgress?: boolean, options?: {
|
||||
public patchSettingLogoEndpoint(logo?: Blob, observe?: 'body', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<any>;
|
||||
public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'response', reportProgress?: boolean, options?: {
|
||||
public patchSettingLogoEndpoint(logo?: Blob, observe?: 'response', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<HttpResponse<any>>;
|
||||
public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'events', reportProgress?: boolean, options?: {
|
||||
public patchSettingLogoEndpoint(logo?: Blob, observe?: 'events', reportProgress?: boolean, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<HttpEvent<any>>;
|
||||
public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe: any = 'body', reportProgress: boolean = false, options?: {
|
||||
public patchSettingLogoEndpoint(logo?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {
|
||||
httpHeaderAccept?: undefined,
|
||||
context?: HttpContext,
|
||||
transferCache?: boolean
|
||||
}): Observable<any> {
|
||||
if (id === null || id === undefined) {
|
||||
throw new Error('Required parameter id was null or undefined when calling patchSettingLogoEndpoint.');
|
||||
}
|
||||
if (patchSettingLogoDto === null || patchSettingLogoDto === undefined) {
|
||||
throw new Error('Required parameter patchSettingLogoDto was null or undefined when calling patchSettingLogoEndpoint.');
|
||||
}
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
@@ -408,14 +227,27 @@ export class SettingsService extends BaseService {
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [
|
||||
'application/json'
|
||||
'multipart/form-data'
|
||||
];
|
||||
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
||||
if (httpContentTypeSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
||||
|
||||
const canConsumeForm = this.canConsumeForm(consumes);
|
||||
|
||||
let localVarFormParams: { append(param: string, value: any): any; };
|
||||
let localVarUseForm = false;
|
||||
let localVarConvertFormParamsToString = false;
|
||||
// use FormData to transmit files using content-type "multipart/form-data"
|
||||
// see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
|
||||
localVarUseForm = canConsumeForm;
|
||||
if (localVarUseForm) {
|
||||
localVarFormParams = new FormData();
|
||||
} else {
|
||||
localVarFormParams = new HttpParams({encoder: this.encoder});
|
||||
}
|
||||
|
||||
if (logo !== undefined) {
|
||||
localVarFormParams = localVarFormParams.append('logo', <any>logo) as any || localVarFormParams;
|
||||
}
|
||||
|
||||
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||
@@ -429,20 +261,12 @@ export class SettingsService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
let localVarPath = `/API/settings/${this.configuration.encodeParam({
|
||||
name: "id",
|
||||
value: id,
|
||||
in: "path",
|
||||
style: "simple",
|
||||
explode: false,
|
||||
dataType: "number",
|
||||
dataFormat: "int32"
|
||||
})}/logo`;
|
||||
let localVarPath = `/API/settings/logo`;
|
||||
const {basePath, withCredentials} = this.configuration;
|
||||
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: patchSettingLogoDto,
|
||||
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? {withCredentials} : {}),
|
||||
headers: localVarHeaders,
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
/**
|
||||
* PyroFetes
|
||||
*
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
export interface CreateSettingDto {
|
||||
electronicSignature?: Blob | null;
|
||||
logo?: Blob | null;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ export * from './create-purchase-order-dto';
|
||||
export * from './create-purchase-order-product-dto';
|
||||
export * from './create-purchase-product-dto';
|
||||
export * from './create-quotation-dto';
|
||||
export * from './create-setting-dto';
|
||||
export * from './create-supplier-dto';
|
||||
export * from './create-user-dto';
|
||||
export * from './get-deliverer-dto';
|
||||
@@ -34,8 +33,6 @@ export * from './patch-purchase-product-quantity-dto';
|
||||
export * from './patch-quotation-conditions-sale-dto';
|
||||
export * from './patch-quotation-message-dto';
|
||||
export * from './patch-quotation-product-quantity-dto';
|
||||
export * from './patch-setting-electronic-signature-dto';
|
||||
export * from './patch-setting-logo-dto';
|
||||
export * from './patch-supplier-delivery-delay-dto';
|
||||
export * from './patch-user-password-dto';
|
||||
export * from './patch-ware-house-product-quantity-dto';
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
/**
|
||||
* PyroFetes
|
||||
*
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
export interface PatchSettingElectronicSignatureDto {
|
||||
electronicSignature?: Blob | null;
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
/**
|
||||
* PyroFetes
|
||||
*
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
export interface PatchSettingLogoDto {
|
||||
logo?: Blob | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user