@ikoabo/server
Advanced tools
Comparing version 1.1.10 to 1.1.11
# CHANGELOG | ||
## [1.1.11] - 2020-09-14 | ||
- Adding ObjectId validation on CRUD query | ||
- Update base model to extends base Typegoose class and allow _id on class documents | ||
## [1.1.10] - 2020-09-10 | ||
@@ -4,0 +8,0 @@ - Update CRUD query parameter to handle id string or object query |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CRUD = void 0; | ||
const core_1 = require("@ikoabo/core"); | ||
const mongoose_1 = __importDefault(require("mongoose")); | ||
class CRUD { | ||
@@ -16,3 +20,3 @@ constructor(logger, model, modelname) { | ||
_prepareQuery(queryId) { | ||
if (typeof queryId === "string") { | ||
if (typeof queryId === "string" || mongoose_1.default.isValidObjectId(queryId)) { | ||
return { _id: queryId }; | ||
@@ -19,0 +23,0 @@ } |
@@ -1,2 +0,3 @@ | ||
export declare class BaseModel { | ||
import { defaultClasses } from "@typegoose/typegoose"; | ||
export declare class BaseModel extends defaultClasses.Base implements defaultClasses.TimeStamps { | ||
status?: number; | ||
@@ -3,0 +4,0 @@ owner?: string; |
@@ -19,3 +19,3 @@ "use strict"; | ||
const mongoose_1 = __importDefault(require("mongoose")); | ||
class BaseModel { | ||
class BaseModel extends typegoose_1.defaultClasses.Base { | ||
} | ||
@@ -22,0 +22,0 @@ __decorate([ |
{ | ||
"name": "@ikoabo/server", | ||
"version": "1.1.10", | ||
"version": "1.1.11", | ||
"description": "IKOA Business Opportunity Server API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
80590
43
930