express-ext 0.1.34 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +9 -9
- package/package.json +1 -1
- package/src/LogController.ts +1 -1
- package/src/index.ts +3 -3
package/lib/index.js
CHANGED
|
@@ -191,8 +191,8 @@ var FollowController = (function () {
|
|
|
191
191
|
return FollowController;
|
|
192
192
|
}());
|
|
193
193
|
exports.FollowController = FollowController;
|
|
194
|
-
var
|
|
195
|
-
function
|
|
194
|
+
var UserReactionController = (function () {
|
|
195
|
+
function UserReactionController(log, service, author, id, reaction) {
|
|
196
196
|
this.log = log;
|
|
197
197
|
this.service = service;
|
|
198
198
|
this.author = author;
|
|
@@ -202,7 +202,7 @@ var ReactionController = (function () {
|
|
|
202
202
|
this.unreact = this.unreact.bind(this);
|
|
203
203
|
this.checkReaction = this.checkReaction.bind(this);
|
|
204
204
|
}
|
|
205
|
-
|
|
205
|
+
UserReactionController.prototype.react = function (req, res) {
|
|
206
206
|
var _this = this;
|
|
207
207
|
var id = req.params.id;
|
|
208
208
|
var author = req.params.author;
|
|
@@ -223,7 +223,7 @@ var ReactionController = (function () {
|
|
|
223
223
|
return res.status(200).json(count).end();
|
|
224
224
|
}).catch(function (err) { return http_1.handleError(err, res, _this.log); });
|
|
225
225
|
};
|
|
226
|
-
|
|
226
|
+
UserReactionController.prototype.unreact = function (req, res) {
|
|
227
227
|
var _this = this;
|
|
228
228
|
var id = req.params.id;
|
|
229
229
|
var author = req.params.author;
|
|
@@ -244,7 +244,7 @@ var ReactionController = (function () {
|
|
|
244
244
|
return res.status(200).json(count).end();
|
|
245
245
|
}).catch(function (err) { return http_1.handleError(err, res, _this.log); });
|
|
246
246
|
};
|
|
247
|
-
|
|
247
|
+
UserReactionController.prototype.checkReaction = function (req, res) {
|
|
248
248
|
var _this = this;
|
|
249
249
|
var id = req.params.id;
|
|
250
250
|
var author = req.params.author;
|
|
@@ -260,8 +260,8 @@ var ReactionController = (function () {
|
|
|
260
260
|
return res.status(200).json(count).end();
|
|
261
261
|
}).catch(function (err) { return http_1.handleError(err, res, _this.log); });
|
|
262
262
|
};
|
|
263
|
-
return
|
|
263
|
+
return UserReactionController;
|
|
264
264
|
}());
|
|
265
|
-
exports.
|
|
266
|
-
exports.ReactController =
|
|
267
|
-
exports.
|
|
265
|
+
exports.UserReactionController = UserReactionController;
|
|
266
|
+
exports.ReactController = UserReactionController;
|
|
267
|
+
exports.ReactionController = UserReactionController;
|
package/package.json
CHANGED
package/src/LogController.ts
CHANGED
|
@@ -69,7 +69,7 @@ export class LogController {
|
|
|
69
69
|
}
|
|
70
70
|
config(req: Request, res: Response) {
|
|
71
71
|
const obj: LogConfig = req.body;
|
|
72
|
-
if (!obj || obj === '') {
|
|
72
|
+
if (!obj || (obj as any) === '') {
|
|
73
73
|
return res.status(400).end('The request body cannot be empty');
|
|
74
74
|
}
|
|
75
75
|
if (!this.logger) {
|
package/src/index.ts
CHANGED
|
@@ -203,7 +203,7 @@ export interface ReactService {
|
|
|
203
203
|
checkReaction(id: string, author: string): Promise<number>;
|
|
204
204
|
}
|
|
205
205
|
// tslint:disable-next-line:max-classes-per-file
|
|
206
|
-
export class
|
|
206
|
+
export class UserReactionController {
|
|
207
207
|
constructor(public log: Log, public service: ReactService, public author: string, id: string, public reaction: string) {
|
|
208
208
|
this.id = (id && id.length > 0 ? id : 'id');
|
|
209
209
|
this.react = this.react.bind(this);
|
|
@@ -267,5 +267,5 @@ export class ReactionController {
|
|
|
267
267
|
}).catch(err => handleError(err, res, this.log));
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
export const ReactController =
|
|
271
|
-
export const
|
|
270
|
+
export const ReactController = UserReactionController;
|
|
271
|
+
export const ReactionController = UserReactionController;
|