Sha256: 41bdaaa7efb979de75d542b3399cce3076d6ec9b02caba3bb10343e77fcc3659

Contents?: true

Size: 771 Bytes

Versions: 14

Compression:

Stored size: 771 Bytes

Contents

import Vue from 'vue';

export default Vue.component('asset-form', {

  props: {
    asset: {
      coerce: (val) => JSON.parse(val)
    }
  },

  computed: {
    createPath: function() {
      return `${ PushType.Routes.adminPath }/media`;
    },

    updatePath: function() {
      return `${ PushType.Routes.adminPath }/media/${ this.asset.id }`;
    },

    saveMethod: function() {
      return this.asset['new_record?'] ? 'post' : 'patch';
    },

    saveUrl: function() {
      return this.asset['new_record?'] ? this.createPath : this.updatePath;
    },

    saveButtonText: function() {
      return this.asset['new_record?'] ? 'Upload file' : 'Update media';
    }
  },

  methods: {
    afterUpload: function(asset) {
      this.asset = asset;
    }
  }
  
})

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
push_type_admin-0.12.1 app/webpack/javascripts/components/asset-form.es6
push_type_admin-0.12.0 app/webpack/javascripts/components/asset-form.es6
push_type_admin-0.12.0.beta.1 app/webpack/javascripts/components/asset-form.es6
push_type_admin-0.11.2 app/webpack/javascripts/components/asset-form.es6
push_type_admin-0.11.1 app/webpack/javascripts/components/asset-form.es6
push_type_admin-0.11.0.beta.2 app/webpack/javascripts/components/asset-form.es6
push_type_admin-0.11.0.beta.1 app/webpack/javascripts/components/asset-form.es6
push_type_admin-0.10.4 app/webpack/javascripts/components/asset-form.es6
push_type_admin-0.10.3 app/webpack/javascripts/components/asset-form.es6
push_type_admin-0.10.2 app/webpack/javascripts/components/asset-form.es6
push_type_admin-0.10.1 app/webpack/javascripts/components/asset-form.es6
push_type_admin-0.10.0 app/webpack/javascripts/components/asset-form.es6
push_type_admin-0.10.0.beta.5 app/webpack/javascripts/components/asset-form.es6
push_type_admin-0.10.0.beta.3 app/webpack/javascripts/components/asset-form.es6