Skip to content

v1.0.0

Compare
Choose a tag to compare
@chantouchsek chantouchsek released this 08 Aug 16:42
· 956 commits to main since this release
267bf44

Breaking

  • errorsKeyName => errorProperty, Set this in nuxt.config
export default {
  modules: [
    // simple usage
    'vue-api-queries/nuxt',
    // With options
    ['vue-api-queries/nuxt', { errorProperty: 'errors' }],
    '@nuxtjs/axios',
  ],
  apiQueries: { errorProperty: 'errors' },
}
  • in custom method in proxy, remove this.endpoint to set it as default. See the Examples:

Before:

import BaseProxy from './BaseProxy'

class PostProxy extends BaseProxy {
  constructor(parameters = {}) {
    super('posts', parameters)
  }

  tags(id: string | number) {
    return this.submit('get', `/this.endpoint/${id}/tags`)
  }
}

export default PostProxy

Now:

import BaseProxy from './BaseProxy'

class PostProxy extends BaseProxy {
  constructor(parameters = {}) {
    super('posts', parameters)
  }

  tags<T>(id: string | number) {
    return this.submit<T>('get', `${id}/tags`)
  }
}

export default PostProxy

OR

import BaseProxy from './BaseProxy'

class PostProxy extends BaseProxy {
  constructor(parameters = {}) {
    super('posts', parameters)
  }

  tags<T>(id: string | number) {
    return this.submit<T>('get', `/${id}/tags`) // the diff is /
  }
}

export default PostProxy

Added

  • count method to validator
    We can access this like: this.$errors.count() or in template $errors.count() return errors count

All above was merged from PR (#72 )