fixed ruleset issues

This commit is contained in:
Timo 2021-01-06 20:34:11 +02:00
parent 5ff8e1fab8
commit 47700a8170
4 changed files with 13 additions and 20 deletions

View File

@ -63,7 +63,8 @@ export class AddEditDictionaryDialogComponent {
observable = this._dictionaryControllerService.updateType(typeValue, typeValue.type, DEFAULT_RUL_SET_UUID);
} else {
// create mode
observable = this._dictionaryControllerService.addType(typeValue, DEFAULT_RUL_SET_UUID);
typeValue.ruleSetId = DEFAULT_RUL_SET_UUID;
observable = this._dictionaryControllerService.addType(typeValue);
}
//

View File

@ -90,7 +90,7 @@ export class RulesScreenComponent extends ComponentHasChanges {
public async save(): Promise<void> {
this.processing = true;
this._rulesControllerService.uploadRules({ rules: this.editorComponent.getEditor().getValue() }, DEFAULT_RUL_SET_UUID).subscribe(
this._rulesControllerService.uploadRules({ rules: this.editorComponent.getEditor().getValue(), ruleSetId: DEFAULT_RUL_SET_UUID }).subscribe(
() => {
this._initialize();
this._notificationService.showToastNotification(this._translateService.instant('rules-screen.success.generic'), null, NotificationType.SUCCESS);

View File

@ -140,21 +140,17 @@ export class DictionaryControllerService {
* @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 addType(body: TypeValue, ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
public addType(body: TypeValue, observe?: 'body', reportProgress?: boolean): Observable<any>;
public addType(body: TypeValue, ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public addType(body: TypeValue, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public addType(body: TypeValue, ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public addType(body: TypeValue, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public addType(body: TypeValue, ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
public addType(body: TypeValue, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling addType.');
}
if (ruleSetId === null || ruleSetId === undefined) {
throw new Error('Required parameter ruleSetId was null or undefined when calling addType.');
}
let headers = this.defaultHeaders;
// authentication (RED-OAUTH) required
@ -177,7 +173,7 @@ export class DictionaryControllerService {
headers = headers.set('Content-Type', httpContentTypeSelected);
}
return this.httpClient.request<any>('post', `${this.basePath}/dictionary/type/${encodeURIComponent(String(ruleSetId))}`, {
return this.httpClient.request<any>('post', `${this.basePath}/dictionary/type`, {
body: body,
withCredentials: this.configuration.withCredentials,
headers: headers,

View File

@ -133,21 +133,17 @@ export class RulesControllerService {
* @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 uploadRules(body: Rules, ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
public uploadRules(body: Rules, observe?: 'body', reportProgress?: boolean): Observable<any>;
public uploadRules(body: Rules, ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public uploadRules(body: Rules, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public uploadRules(body: Rules, ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public uploadRules(body: Rules, bserve?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public uploadRules(body: Rules, ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
public uploadRules(body: Rules, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling uploadRules.');
}
if (ruleSetId === null || ruleSetId === undefined) {
throw new Error('Required parameter ruleSetId was null or undefined when calling uploadRules.');
}
let headers = this.defaultHeaders;
// authentication (RED-OAUTH) required
@ -170,7 +166,7 @@ export class RulesControllerService {
headers = headers.set('Content-Type', httpContentTypeSelected);
}
return this.httpClient.request<any>('post', `${this.basePath}/rules/${encodeURIComponent(String(ruleSetId))}`, {
return this.httpClient.request<any>('post', `${this.basePath}/rules`, {
body: body,
withCredentials: this.configuration.withCredentials,
headers: headers,