Commit 592f7960 authored by Florian Azizian's avatar Florian Azizian

FEAT #11270 TIME 0:10 get customField id in front + fix wrong delete path

parent 61f5dabf
...@@ -131,7 +131,7 @@ $app->put('/contactsFilling', \Contact\controllers\ContactController::class . ': ...@@ -131,7 +131,7 @@ $app->put('/contactsFilling', \Contact\controllers\ContactController::class . ':
$app->get('/customFields', \CustomField\controllers\CustomFieldController::class . ':get'); $app->get('/customFields', \CustomField\controllers\CustomFieldController::class . ':get');
$app->post('/customFields', \CustomField\controllers\CustomFieldController::class . ':create'); $app->post('/customFields', \CustomField\controllers\CustomFieldController::class . ':create');
$app->put('/customFields/{id}', \CustomField\controllers\CustomFieldController::class . ':update'); $app->put('/customFields/{id}', \CustomField\controllers\CustomFieldController::class . ':update');
$app->delete('/customFields/{id}', \Contact\controllers\ContactController::class . ':delete'); $app->delete('/customFields/{id}', \CustomField\controllers\CustomFieldController::class . ':delete');
//Docservers //Docservers
$app->get('/docservers', \Docserver\controllers\DocserverController::class . ':get'); $app->get('/docservers', \Docserver\controllers\DocserverController::class . ':get');
......
...@@ -112,9 +112,8 @@ export class CustomFieldsAdministrationComponent implements OnInit { ...@@ -112,9 +112,8 @@ export class CustomFieldsAdministrationComponent implements OnInit {
this.dialogRef.afterClosed().pipe( this.dialogRef.afterClosed().pipe(
filter((data: string) => data === 'ok'), filter((data: string) => data === 'ok'),
tap((data: any) => { tap(() => {
newCustomField = { newCustomField = {
id: data.customFieldId,
label: 'Nouveau champ', label: 'Nouveau champ',
type: customFieldType.type, type: customFieldType.type,
values: [], values: [],
...@@ -122,7 +121,8 @@ export class CustomFieldsAdministrationComponent implements OnInit { ...@@ -122,7 +121,8 @@ export class CustomFieldsAdministrationComponent implements OnInit {
} }
}), }),
exhaustMap((data) => this.http.post('../../rest/customFields', newCustomField)), exhaustMap((data) => this.http.post('../../rest/customFields', newCustomField)),
tap(() => { tap((data: any) => {
newCustomField.id = data.customFieldId
this.customFields.push(newCustomField); this.customFields.push(newCustomField);
this.notify.success(this.lang.customFieldAdded); this.notify.success(this.lang.customFieldAdded);
}), }),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment