UNPKG

@fleetbase/fleetops-engine

Version:

Fleet & Transport Management Extension for Fleetbase

20 lines (16 loc) 569 B
import Component from '@glimmer/component'; import { inject as service } from '@ember/service'; import { action } from '@ember/object'; export default class OrderDetailsCustomFieldsComponent extends Component { @service notifications; @action async saveCustomFields() { if (typeof this.args.onChange === 'function') { this.args.onChange(this.args.resource.custom_field_values); } try { await this.args.resource.save(); } catch (err) { this.notifications.serverError(err); } } }