@kohanajs/mixin-orm
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -1,2 +0,2 @@ | ||
const {ControllerMixin} = require('kohanajs'); | ||
const {ORM, ControllerMixin} = require('kohanajs'); | ||
@@ -9,14 +9,13 @@ class ControllerMixinORM extends ControllerMixin{ | ||
action_index(){ | ||
async action_index(){ | ||
if(!this.client.model)return; | ||
const m = new this.client.model(null, {database: this.clientDataBase}); | ||
const instances = m.all(); | ||
const instances = await ORM.getAll( this.client.model , {database: this.clientDataBase}); | ||
this.addBehaviour('instances', instances); | ||
} | ||
action_read(){ | ||
async action_read(){ | ||
if(!this.client.model)return; | ||
const instance = new this.client.model(this.client.mixin.get('id'), {database: this.clientDataBase}); | ||
const instance = await ORM.factory( this.client.model, this.client.mixin.get('id'), {database: this.clientDataBase}); | ||
this.addBehaviour('instance', instance); | ||
@@ -23,0 +22,0 @@ } |
const fs = require('fs'); | ||
const {KOJS} = require('kohanajs'); | ||
const {KohanaJS} = require('kohanajs'); | ||
const {v1: uuidv1} = require('uuid'); | ||
@@ -24,3 +24,3 @@ | ||
mp.on('file', (fieldname, file, filename, encoding, mimetype) => { | ||
const path = `${KOJS.EXE_PATH}/tmp/${uuidv1()}`; | ||
const path = `${KohanaJS.EXE_PATH}/tmp/${uuidv1()}`; | ||
file.pipe(fs.createWriteStream(path)); | ||
@@ -27,0 +27,0 @@ |
@@ -1,3 +0,2 @@ | ||
const {KOJS} = require('kohanajs'); | ||
KOJS.addNodeModules(require.resolve('./')); | ||
require('kohanajs').addNodeModule(__dirname); | ||
@@ -4,0 +3,0 @@ module.exports={ |
{ | ||
"name": "@kohanajs/mixin-orm", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "", | ||
@@ -20,5 +20,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"kohanajs": "^1.0.4", | ||
"kohanajs": "^1.0.8", | ||
"uuid": "^8.3.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8638
174
Updatedkohanajs@^1.0.8