Added settings
This commit is contained in:
Generated
+16
@@ -17,6 +17,7 @@
|
|||||||
"@openapitools/openapi-generator-cli": "^2.25.2",
|
"@openapitools/openapi-generator-cli": "^2.25.2",
|
||||||
"@tailwindcss/postcss": "^4.1.17",
|
"@tailwindcss/postcss": "^4.1.17",
|
||||||
"@tailwindcss/vite": "^4.1.17",
|
"@tailwindcss/vite": "^4.1.17",
|
||||||
|
"browser-image-compression": "^2.0.2",
|
||||||
"ng-zorro-antd": "^20.4.0",
|
"ng-zorro-antd": "^20.4.0",
|
||||||
"postcss": "^8.5.6",
|
"postcss": "^8.5.6",
|
||||||
"rxjs": "~7.8.0",
|
"rxjs": "~7.8.0",
|
||||||
@@ -4432,6 +4433,15 @@
|
|||||||
"node": ">=8"
|
"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": {
|
"node_modules/browserslist": {
|
||||||
"version": "4.28.0",
|
"version": "4.28.0",
|
||||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.0.tgz",
|
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.0.tgz",
|
||||||
@@ -9962,6 +9972,12 @@
|
|||||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
|
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
|
||||||
"license": "MIT"
|
"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": {
|
"node_modules/validate-npm-package-license": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
"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",
|
"@openapitools/openapi-generator-cli": "^2.25.2",
|
||||||
"@tailwindcss/postcss": "^4.1.17",
|
"@tailwindcss/postcss": "^4.1.17",
|
||||||
"@tailwindcss/vite": "^4.1.17",
|
"@tailwindcss/vite": "^4.1.17",
|
||||||
|
"browser-image-compression": "^2.0.2",
|
||||||
"ng-zorro-antd": "^20.4.0",
|
"ng-zorro-antd": "^20.4.0",
|
||||||
"postcss": "^8.5.6",
|
"postcss": "^8.5.6",
|
||||||
"rxjs": "~7.8.0",
|
"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 -->
|
<!-- Logo -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="row-left">
|
<div class="row-left">
|
||||||
|
@if (settings().logo) {
|
||||||
|
<img [src]="'data:image/jpeg;base64,' + settings().logo" alt=""/>
|
||||||
|
} @else {
|
||||||
<img [src]="setting.logo" alt="logo">
|
<img [src]="setting.logo" alt="logo">
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row-right">
|
<div class="row-right">
|
||||||
<nz-form-item>
|
<nz-form-item>
|
||||||
<nz-form-label nzSpan="9">Logo</nz-form-label>
|
<nz-form-label nzSpan="9">Logo</nz-form-label>
|
||||||
<nz-form-control nzSpan="25">
|
<nz-form-control nzErrorTip="Ce champ est requis">
|
||||||
<input nz-input type="file" formControlName="logo"/>
|
<input #fileInputLogo nz-input type="file" placeholder="Déposer"
|
||||||
|
(change)="onFileChange('logo', fileInputLogo.files)">
|
||||||
</nz-form-control>
|
</nz-form-control>
|
||||||
</nz-form-item>
|
</nz-form-item>
|
||||||
</div>
|
</div>
|
||||||
@@ -19,17 +24,21 @@
|
|||||||
<!-- Signature -->
|
<!-- Signature -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="row-left">
|
<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>
|
||||||
|
|
||||||
<div class="row-right">
|
<div class="row-right">
|
||||||
<nz-form-item>
|
<nz-form-item>
|
||||||
<nz-form-label nzSpan="9">Signature</nz-form-label>
|
<nz-form-label nzSpan="9">Signature</nz-form-label>
|
||||||
<nz-form-control nzSpan="25">
|
<nz-form-control nzErrorTip="Ce champ est requis">
|
||||||
<input nz-input type="file" formControlName="signature"/>
|
<input #fileInputSignature nz-input type="file" placeholder="Déposer"
|
||||||
|
(change)="onFileChange('electronicSignature', fileInputSignature.files)">
|
||||||
</nz-form-control>
|
</nz-form-control>
|
||||||
</nz-form-item>
|
</nz-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</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 {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from "@angular/forms";
|
||||||
import {NzColDirective} from "ng-zorro-antd/grid";
|
import {NzColDirective} from "ng-zorro-antd/grid";
|
||||||
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
|
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
|
||||||
import {NzInputDirective} from "ng-zorro-antd/input";
|
import {NzInputDirective} from "ng-zorro-antd/input";
|
||||||
import {SettingInfo} from "../../interfaces/setting.interface";
|
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({
|
@Component({
|
||||||
selector: 'app-setting-form',
|
selector: 'app-setting-form',
|
||||||
@@ -15,30 +19,68 @@ import {SettingInfo} from "../../interfaces/setting.interface";
|
|||||||
NzFormItemComponent,
|
NzFormItemComponent,
|
||||||
NzFormLabelComponent,
|
NzFormLabelComponent,
|
||||||
NzInputDirective,
|
NzInputDirective,
|
||||||
ReactiveFormsModule
|
ReactiveFormsModule,
|
||||||
],
|
],
|
||||||
templateUrl: './setting-form.html',
|
templateUrl: './setting-form.html',
|
||||||
styleUrl: './setting-form.css',
|
styleUrl: './setting-form.css',
|
||||||
})
|
})
|
||||||
export class SettingForm {
|
export class SettingForm implements OnInit {
|
||||||
settingForm: FormGroup = new FormGroup({
|
private settingsService = inject(SettingsService);
|
||||||
logo: new FormControl<string>(null),
|
private notificationService = inject(NzNotificationService);
|
||||||
signature: new FormControl<string>(null)
|
|
||||||
})
|
|
||||||
|
|
||||||
submitForm() {
|
settings = signal<GetSettingDto>({});
|
||||||
// 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()
|
|
||||||
}
|
|
||||||
|
|
||||||
setting: SettingInfo = {
|
setting: SettingInfo = {
|
||||||
logo: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png',
|
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 {
|
export interface SettingInfo {
|
||||||
logo: string;
|
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-order-product-dto.ts
|
||||||
model/create-purchase-product-dto.ts
|
model/create-purchase-product-dto.ts
|
||||||
model/create-quotation-dto.ts
|
model/create-quotation-dto.ts
|
||||||
model/create-setting-dto.ts
|
|
||||||
model/create-supplier-dto.ts
|
model/create-supplier-dto.ts
|
||||||
model/create-user-dto.ts
|
model/create-user-dto.ts
|
||||||
model/get-deliverer-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-conditions-sale-dto.ts
|
||||||
model/patch-quotation-message-dto.ts
|
model/patch-quotation-message-dto.ts
|
||||||
model/patch-quotation-product-quantity-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-supplier-delivery-delay-dto.ts
|
||||||
model/patch-user-password-dto.ts
|
model/patch-user-password-dto.ts
|
||||||
model/patch-ware-house-product-quantity-dto.ts
|
model/patch-ware-house-product-quantity-dto.ts
|
||||||
|
|||||||
@@ -17,14 +17,8 @@ import {
|
|||||||
import {CustomHttpParameterCodec} from '../encoder';
|
import {CustomHttpParameterCodec} from '../encoder';
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
import {CreateSettingDto} from '../model/create-setting-dto';
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import {GetSettingDto} from '../model/get-setting-dto';
|
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
|
// @ts-ignore
|
||||||
import {BASE_PATH, COLLECTION_FORMATS} from '../variables';
|
import {BASE_PATH, COLLECTION_FORMATS} from '../variables';
|
||||||
@@ -42,188 +36,30 @@ export class SettingsService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @endpoint post /API/settings
|
* @endpoint get /API/settings
|
||||||
* @param createSettingDto
|
|
||||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
* @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.
|
* @param reportProgress flag to report request and response progress.
|
||||||
*/
|
*/
|
||||||
public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'body', reportProgress?: boolean, options?: {
|
public getSettingEndpoint(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?: {
|
|
||||||
httpHeaderAccept?: 'application/json',
|
httpHeaderAccept?: 'application/json',
|
||||||
context?: HttpContext,
|
context?: HttpContext,
|
||||||
transferCache?: boolean
|
transferCache?: boolean
|
||||||
}): Observable<GetSettingDto>;
|
}): Observable<GetSettingDto>;
|
||||||
public getSettingEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
|
public getSettingEndpoint(observe?: 'response', reportProgress?: boolean, options?: {
|
||||||
httpHeaderAccept?: 'application/json',
|
httpHeaderAccept?: 'application/json',
|
||||||
context?: HttpContext,
|
context?: HttpContext,
|
||||||
transferCache?: boolean
|
transferCache?: boolean
|
||||||
}): Observable<HttpResponse<GetSettingDto>>;
|
}): Observable<HttpResponse<GetSettingDto>>;
|
||||||
public getSettingEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
|
public getSettingEndpoint(observe?: 'events', reportProgress?: boolean, options?: {
|
||||||
httpHeaderAccept?: 'application/json',
|
httpHeaderAccept?: 'application/json',
|
||||||
context?: HttpContext,
|
context?: HttpContext,
|
||||||
transferCache?: boolean
|
transferCache?: boolean
|
||||||
}): Observable<HttpEvent<GetSettingDto>>;
|
}): 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',
|
httpHeaderAccept?: 'application/json',
|
||||||
context?: HttpContext,
|
context?: HttpContext,
|
||||||
transferCache?: boolean
|
transferCache?: boolean
|
||||||
}): Observable<any> {
|
}): Observable<any> {
|
||||||
if (id === null || id === undefined) {
|
|
||||||
throw new Error('Required parameter id was null or undefined when calling getSettingEndpoint.');
|
|
||||||
}
|
|
||||||
|
|
||||||
let localVarHeaders = this.defaultHeaders;
|
let localVarHeaders = this.defaultHeaders;
|
||||||
|
|
||||||
@@ -250,15 +86,7 @@ export class SettingsService extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let localVarPath = `/API/settings/${this.configuration.encodeParam({
|
let localVarPath = `/API/settings`;
|
||||||
name: "id",
|
|
||||||
value: id,
|
|
||||||
in: "path",
|
|
||||||
style: "simple",
|
|
||||||
explode: false,
|
|
||||||
dataType: "number",
|
|
||||||
dataFormat: "int32"
|
|
||||||
})}`;
|
|
||||||
const {basePath, withCredentials} = this.configuration;
|
const {basePath, withCredentials} = this.configuration;
|
||||||
return this.httpClient.request<GetSettingDto>('get', `${basePath}${localVarPath}`,
|
return this.httpClient.request<GetSettingDto>('get', `${basePath}${localVarPath}`,
|
||||||
{
|
{
|
||||||
@@ -274,38 +102,31 @@ export class SettingsService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @endpoint patch /API/settings/{id}/ElectronicSignature
|
* @endpoint patch /API/settings/electronicSignature
|
||||||
* @param id
|
* @param electronicSignature
|
||||||
* @param patchSettingElectronicSignatureDto
|
|
||||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
* @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.
|
* @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,
|
httpHeaderAccept?: undefined,
|
||||||
context?: HttpContext,
|
context?: HttpContext,
|
||||||
transferCache?: boolean
|
transferCache?: boolean
|
||||||
}): Observable<any>;
|
}): Observable<any>;
|
||||||
public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'response', reportProgress?: boolean, options?: {
|
public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'response', reportProgress?: boolean, options?: {
|
||||||
httpHeaderAccept?: undefined,
|
httpHeaderAccept?: undefined,
|
||||||
context?: HttpContext,
|
context?: HttpContext,
|
||||||
transferCache?: boolean
|
transferCache?: boolean
|
||||||
}): Observable<HttpResponse<any>>;
|
}): 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,
|
httpHeaderAccept?: undefined,
|
||||||
context?: HttpContext,
|
context?: HttpContext,
|
||||||
transferCache?: boolean
|
transferCache?: boolean
|
||||||
}): Observable<HttpEvent<any>>;
|
}): 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,
|
httpHeaderAccept?: undefined,
|
||||||
context?: HttpContext,
|
context?: HttpContext,
|
||||||
transferCache?: boolean
|
transferCache?: boolean
|
||||||
}): Observable<any> {
|
}): 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;
|
let localVarHeaders = this.defaultHeaders;
|
||||||
|
|
||||||
@@ -318,14 +139,27 @@ export class SettingsService extends BaseService {
|
|||||||
|
|
||||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||||
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
'application/json'
|
'multipart/form-data'
|
||||||
];
|
];
|
||||||
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
|
||||||
if (httpContentTypeSelected !== undefined) {
|
const canConsumeForm = this.canConsumeForm(consumes);
|
||||||
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
||||||
|
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';
|
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||||
@@ -339,20 +173,12 @@ export class SettingsService extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let localVarPath = `/API/settings/${this.configuration.encodeParam({
|
let localVarPath = `/API/settings/electronicSignature`;
|
||||||
name: "id",
|
|
||||||
value: id,
|
|
||||||
in: "path",
|
|
||||||
style: "simple",
|
|
||||||
explode: false,
|
|
||||||
dataType: "number",
|
|
||||||
dataFormat: "int32"
|
|
||||||
})}/ElectronicSignature`;
|
|
||||||
const {basePath, withCredentials} = this.configuration;
|
const {basePath, withCredentials} = this.configuration;
|
||||||
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
|
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
|
||||||
{
|
{
|
||||||
context: localVarHttpContext,
|
context: localVarHttpContext,
|
||||||
body: patchSettingElectronicSignatureDto,
|
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
|
||||||
responseType: <any>responseType_,
|
responseType: <any>responseType_,
|
||||||
...(withCredentials ? {withCredentials} : {}),
|
...(withCredentials ? {withCredentials} : {}),
|
||||||
headers: localVarHeaders,
|
headers: localVarHeaders,
|
||||||
@@ -364,38 +190,31 @@ export class SettingsService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @endpoint patch /API/settings/{id}/logo
|
* @endpoint patch /API/settings/logo
|
||||||
* @param id
|
* @param logo
|
||||||
* @param patchSettingLogoDto
|
|
||||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
* @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.
|
* @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,
|
httpHeaderAccept?: undefined,
|
||||||
context?: HttpContext,
|
context?: HttpContext,
|
||||||
transferCache?: boolean
|
transferCache?: boolean
|
||||||
}): Observable<any>;
|
}): Observable<any>;
|
||||||
public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'response', reportProgress?: boolean, options?: {
|
public patchSettingLogoEndpoint(logo?: Blob, observe?: 'response', reportProgress?: boolean, options?: {
|
||||||
httpHeaderAccept?: undefined,
|
httpHeaderAccept?: undefined,
|
||||||
context?: HttpContext,
|
context?: HttpContext,
|
||||||
transferCache?: boolean
|
transferCache?: boolean
|
||||||
}): Observable<HttpResponse<any>>;
|
}): 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,
|
httpHeaderAccept?: undefined,
|
||||||
context?: HttpContext,
|
context?: HttpContext,
|
||||||
transferCache?: boolean
|
transferCache?: boolean
|
||||||
}): Observable<HttpEvent<any>>;
|
}): 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,
|
httpHeaderAccept?: undefined,
|
||||||
context?: HttpContext,
|
context?: HttpContext,
|
||||||
transferCache?: boolean
|
transferCache?: boolean
|
||||||
}): Observable<any> {
|
}): 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;
|
let localVarHeaders = this.defaultHeaders;
|
||||||
|
|
||||||
@@ -408,14 +227,27 @@ export class SettingsService extends BaseService {
|
|||||||
|
|
||||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||||
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
const consumes: string[] = [
|
const consumes: string[] = [
|
||||||
'application/json'
|
'multipart/form-data'
|
||||||
];
|
];
|
||||||
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
|
|
||||||
if (httpContentTypeSelected !== undefined) {
|
const canConsumeForm = this.canConsumeForm(consumes);
|
||||||
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
||||||
|
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';
|
let responseType_: 'text' | 'json' | 'blob' = 'json';
|
||||||
@@ -429,20 +261,12 @@ export class SettingsService extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let localVarPath = `/API/settings/${this.configuration.encodeParam({
|
let localVarPath = `/API/settings/logo`;
|
||||||
name: "id",
|
|
||||||
value: id,
|
|
||||||
in: "path",
|
|
||||||
style: "simple",
|
|
||||||
explode: false,
|
|
||||||
dataType: "number",
|
|
||||||
dataFormat: "int32"
|
|
||||||
})}/logo`;
|
|
||||||
const {basePath, withCredentials} = this.configuration;
|
const {basePath, withCredentials} = this.configuration;
|
||||||
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
|
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
|
||||||
{
|
{
|
||||||
context: localVarHttpContext,
|
context: localVarHttpContext,
|
||||||
body: patchSettingLogoDto,
|
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
|
||||||
responseType: <any>responseType_,
|
responseType: <any>responseType_,
|
||||||
...(withCredentials ? {withCredentials} : {}),
|
...(withCredentials ? {withCredentials} : {}),
|
||||||
headers: localVarHeaders,
|
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-order-product-dto';
|
||||||
export * from './create-purchase-product-dto';
|
export * from './create-purchase-product-dto';
|
||||||
export * from './create-quotation-dto';
|
export * from './create-quotation-dto';
|
||||||
export * from './create-setting-dto';
|
|
||||||
export * from './create-supplier-dto';
|
export * from './create-supplier-dto';
|
||||||
export * from './create-user-dto';
|
export * from './create-user-dto';
|
||||||
export * from './get-deliverer-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-conditions-sale-dto';
|
||||||
export * from './patch-quotation-message-dto';
|
export * from './patch-quotation-message-dto';
|
||||||
export * from './patch-quotation-product-quantity-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-supplier-delivery-delay-dto';
|
||||||
export * from './patch-user-password-dto';
|
export * from './patch-user-password-dto';
|
||||||
export * from './patch-ware-house-product-quantity-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