Skip to content

Commit

Permalink
fix(admin-ui): Fix creating new Channels
Browse files Browse the repository at this point in the history
Closes #182
  • Loading branch information
michaelbromley committed Oct 10, 2019
1 parent aeae0d9 commit b8e4c6c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { getDefaultLanguage } from '@vendure/admin-ui/src/app/common/utilities/get-default-language';
import { Observable } from 'rxjs';
import { mergeMap, take } from 'rxjs/operators';
import { DEFAULT_CHANNEL_CODE } from 'shared/shared-constants';
Expand Down Expand Up @@ -69,13 +70,15 @@ export class ChannelDetailComponent extends BaseDetailComponent<Channel.Fragment
return;
}
const formValue = this.detailForm.value;
const input = {
const input: CreateChannelInput = {
code: formValue.code,
token: formValue.token,
defaultLanguageCode: getDefaultLanguage(),
pricesIncludeTax: formValue.pricesIncludeTax,
currencyCode: formValue.currencyCode,
defaultShippingZoneId: formValue.defaultShippingZoneId,
defaultTaxZoneId: formValue.defaultTaxZoneId,
} as CreateChannelInput;
};
this.dataService.settings.createChannel(input).subscribe(
data => {
this.notificationService.success(_('common.notify-create-success'), {
Expand Down

0 comments on commit b8e4c6c

Please sign in to comment.