@pasabi/api-rest-comments-tags-flags
Advanced tools
Comparing version 0.9.16 to 0.9.17
@@ -50,7 +50,8 @@ "use strict"; | ||
}; | ||
const success = await flagsService.create(flag); | ||
const response = await flagsService.create(flag); | ||
// TODO theoretically add a linter rule to check for auditedActivity in a post / put / patch / delete | ||
// TODO - add auditing here | ||
// ctx.auditedActivity = { verb: "add-flag", objects: [], target: {entityId, entityType}}; | ||
if (success == true) { | ||
if (response.success == true) { | ||
flag._id = response.id; | ||
// should the callback add to the ctx.auditedActivity | ||
@@ -60,3 +61,3 @@ addFlagCallback(flag, ctx); | ||
ctx.payload = { | ||
success, | ||
success: response.success, | ||
}; | ||
@@ -63,0 +64,0 @@ return next(); |
@@ -1,4 +0,5 @@ | ||
import { Collection, Db } from "mongodb"; | ||
import { Collection, Db, ObjectId } from "mongodb"; | ||
import UsersService from "../../services/users"; | ||
export interface FlagData { | ||
_id?: ObjectId; | ||
reason_id: string; | ||
@@ -24,5 +25,8 @@ id: string; | ||
reasonForId(id: string): Promise<import("bson").Document>; | ||
create(flagIn: FlagData): Promise<boolean>; | ||
create(flagIn: FlagData): Promise<{ | ||
id: ObjectId; | ||
success: boolean; | ||
}>; | ||
findFlagsForEntity(entityType: string, entityId: string): Promise<import("bson").Document[]>; | ||
} | ||
//# sourceMappingURL=index.d.ts.map |
@@ -52,3 +52,3 @@ "use strict"; | ||
const result = await this.flagsCollection.insertOne(flag); | ||
return result.acknowledged; | ||
return { id: result.insertedId, success: result.acknowledged }; | ||
} | ||
@@ -55,0 +55,0 @@ async findFlagsForEntity(entityType, entityId) { |
{ | ||
"name": "@pasabi/api-rest-comments-tags-flags", | ||
"version": "0.9.16", | ||
"version": "0.9.17", | ||
"description": "Rest APIs for Comments, Tags and Flags", | ||
@@ -46,3 +46,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "84697f2375d64668fb012280811fa65d93be658a" | ||
"gitHead": "0b3d1256cdb6f403d95152f3123de574e30a18b6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
92432
1641