Skip to content

Commit

Permalink
feat: add relationship id into sendData form site
Browse files Browse the repository at this point in the history
Add type_site and id_site_group to the form site

Reviewed-by: andriac
[Refs_ticket]: #5 et #6
  • Loading branch information
andriacap authored and Maxime Vergez committed Apr 14, 2023
1 parent 516efbc commit 380b265
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions backend/gn_module_monitoring/routes/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from gn_module_monitoring.config.repositories import get_config
from gn_module_monitoring.monitoring.models import BibTypeSite, TMonitoringSites, TNomenclatures
from gn_module_monitoring.monitoring.schemas import BibTypeSiteSchema, MonitoringSitesSchema
from gn_module_monitoring.routes.sites_groups import create_or_update_object_api
from gn_module_monitoring.utils.routes import (
create_or_update_object_api_sites_sites_group,
filter_params,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ export class MonitoringFormComponentG implements OnInit {
onSubmit() {
const { patch_update, ...sendValue } = this.dataForm;
const objToUpdateOrCreate = this._formService.postData(sendValue, this.obj);
console.log(objToUpdateOrCreate);
const action = this.obj.id
? this._apiGeomService.patch(this.obj.id, objToUpdateOrCreate)
: this._apiGeomService.create(objToUpdateOrCreate);
Expand Down Expand Up @@ -374,6 +375,7 @@ export class MonitoringFormComponentG implements OnInit {
}

getConfigFromBtnSelect(event) {
console.log(event);
// this.obj.specific == undefined ? (this.obj.specific = {}) : null;
// TODO: Ajout de tous les id_parents ["id_sites_groups" etc ] dans l'objet obj.dataComplement
this.obj.specific = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export class MonitoringSitesCreateComponent implements OnInit {
private _formService: FormService,
private _formBuilder: FormBuilder,
private siteService: SitesService,
private _objService: ObjectService
private _Activatedroute: ActivatedRoute,
private _objService:ObjectService
) {}

ngOnInit() {
Expand All @@ -52,6 +53,8 @@ export class MonitoringSitesCreateComponent implements OnInit {
});
}



partialfuncToFilt(
pageNumber: number,
limit: number,
Expand Down
5 changes: 1 addition & 4 deletions frontend/app/services/form.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ export class FormService {
if (!elem.type_widget) {
continue;
}
observables[attribut_name] = this._objService.toForm(
elem,
properties[attribut_name]
);
observables[attribut_name] = this._objService.toForm(elem, properties[attribut_name]);
}

return forkJoin(observables).pipe(
Expand Down

0 comments on commit 380b265

Please sign in to comment.