убрал возможность редактирования имени при оформлении заказа, информацию из айка сделал на прошлых задачах
This commit is contained in:
gofnnp 2023-05-29 07:36:34 +04:00
parent 2428870ba8
commit ac7709b64e
2 changed files with 12 additions and 12 deletions

View File

@ -146,7 +146,7 @@ export class UserDataOrderComponent implements OnInit, OnDestroy {
const houseValidators = name === 'Доставка' ? [Validators.required, Validators.maxLength(10),] : [] const houseValidators = name === 'Доставка' ? [Validators.required, Validators.maxLength(10),] : []
const userDataForm = this.fb.group({ const userDataForm = this.fb.group({
phone: [this.userData.phone], phone: [this.userData.phone],
first_name: [this.userData.first_name, [Validators.required, Validators.minLength(2), Validators.maxLength(255),]], first_name: [this.userData.first_name, [Validators.required, Validators.minLength(2), Validators.maxLength(255)]],
// last_name: [this.userData.last_name, [Validators.required, Validators.minLength(2), Validators.maxLength(255),]], // last_name: [this.userData.last_name, [Validators.required, Validators.minLength(2), Validators.maxLength(255),]],
street: [this.userData.street, streetValidators], street: [this.userData.street, streetValidators],
house: [this.userData.house, houseValidators], house: [this.userData.house, houseValidators],
@ -241,7 +241,7 @@ export class UserDataOrderComponent implements OnInit, OnDestroy {
return this.fb.group({ return this.fb.group({
selectedTerminal: [{ value: this.selectedTerminal, disabled: true }, []], selectedTerminal: [{ value: this.selectedTerminal, disabled: true }, []],
phone: [this.userData.phone], phone: [this.userData.phone],
first_name: [this.userData.name, [Validators.required, Validators.minLength(2), Validators.maxLength(255),]], first_name: [{value: this.userData.name, disabled: true}, [Validators.required, Validators.minLength(2), Validators.maxLength(255),]],
// last_name: [this.userData.last_name, [Validators.required, Validators.minLength(2), Validators.maxLength(255),]], // last_name: [this.userData.last_name, [Validators.required, Validators.minLength(2), Validators.maxLength(255),]],
street: [{ value: this.userData.street, disabled: isSelfDelivery }, isSelfDelivery ?? [Validators.required, Validators.minLength(2), Validators.maxLength(255),]], street: [{ value: this.userData.street, disabled: isSelfDelivery }, isSelfDelivery ?? [Validators.required, Validators.minLength(2), Validators.maxLength(255),]],
house: [{ value: this.userData.house, disabled: isSelfDelivery }, isSelfDelivery ?? [Validators.required, Validators.maxLength(10), Validators.pattern('^\\d+[-|\\d]+\\d+$|^\\d*$')]], house: [{ value: this.userData.house, disabled: isSelfDelivery }, isSelfDelivery ?? [Validators.required, Validators.maxLength(10), Validators.pattern('^\\d+[-|\\d]+\\d+$|^\\d*$')]],

View File

@ -171,16 +171,16 @@ export class OrderService {
.pipe( .pipe(
tap({ tap({
next: (_) => { next: (_) => {
this.jsonRpcService // this.jsonRpcService
.rpc( // .rpc(
{ // {
method: 'updateAdditionalInfo', // method: 'updateAdditionalInfo',
params: [this.order.userData, this.order.deliveryData], // params: [this.order.userData, this.order.deliveryData],
}, // },
RpcService.authService, // RpcService.authService,
true // true
) // )
.subscribe(); // .subscribe();
}, },
}) })
); );