rapidjs / rapid.js

An ORM-like Interface and a Router For Your API Requests
https://rapidjs.drewjbartlett.com
711 stars 45 forks source link

save, update not work. #56

Open fenixphp opened 5 years ago

fenixphp commented 5 years ago
export default new Base({
  routes: {
    model: 'data/account/user',
    collection: 'data/account/user'
  },
  suffixes: {
    create: '',
    update: '',
    destroy: ''
  },
  methods: {
    update: 'put',
    destroy: 'delete'
  }
});

Not work

await Phone.update(phone.id, phone);
await Phone.save(phone.id, phone);

Work

await Phone
.id(phone.id)
.withParams(phone)
.put();