Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 5189468

Browse files
author
Dekel
committed
Updated docs and bumped version to 1.1.0
1 parent 7fff580 commit 5189468

File tree

3 files changed

+24
-32
lines changed

3 files changed

+24
-32
lines changed

README.md

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,18 @@ const { Model } = require('objection');
7272

7373
class User extends Model {
7474

75-
static get tableName() {
76-
return 'user';
77-
}
75+
static tableName = 'user'
76+
77+
static jsonSchema = {
78+
type: 'object',
79+
required: ['firstName', 'lastName'],
7880

79-
static get jsonSchema() {
80-
return {
81-
type: 'object',
82-
required: ['firstName', 'lastName'],
83-
84-
properties: {
85-
id: { type: 'integer' },
86-
firstName: { type: 'string', maxLength: 45 },
87-
lastName: { type: 'string', maxLength: 45 },
88-
status: { type: 'string', enum: ['active', 'disabled'], default: 'active' },
89-
},
90-
};
81+
properties: {
82+
id: { type: 'integer' },
83+
firstName: { type: 'string', maxLength: 45 },
84+
lastName: { type: 'string', maxLength: 45 },
85+
status: { type: 'string', enum: ['active', 'disabled'], default: 'active' },
86+
}
9187
}
9288

9389
static get relationMappings() {
@@ -132,22 +128,18 @@ const { Model } = require('objection');
132128

133129
class Todo extends Model {
134130

135-
static get tableName() {
136-
return 'todo';
137-
}
131+
static tableName = 'todo'
132+
133+
static jsonSchema = {
134+
type: 'object',
135+
required: ['userId', 'text'],
138136

139-
static get jsonSchema() {
140-
return {
141-
type: 'object',
142-
required: ['userId', 'text'],
143-
144-
properties: {
145-
id: { type: 'integer' },
146-
userId: { type: 'integer' },
147-
text: { type: 'string' },
148-
complete: { type: 'boolean', default: false },
149-
},
150-
};
137+
properties: {
138+
id: { type: 'integer' },
139+
userId: { type: 'integer' },
140+
text: { type: 'string' },
141+
complete: { type: 'boolean', default: false },
142+
}
151143
}
152144

153145
static get relationMappings() {

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "feathers-objection",
33
"description": "A service plugin for ObjectionJS an ORM based on KnexJS",
4-
"version": "1.0.6",
4+
"version": "1.1.0",
55
"homepage": "https://github.com/mcchrish/feathers-objection",
66
"keywords": [
77
"feathers",

0 commit comments

Comments
 (0)