mirror of
https://github.com/wassname/talk.git
synced 2026-08-14 12:50:17 +08:00
updated tests
This commit is contained in:
+1
-1
@@ -58,7 +58,7 @@ module.exports = class ActionsService {
|
||||
* @param {String} action the new action to the item
|
||||
* @return {Promise}
|
||||
*/
|
||||
static async insertUserAction(action) {
|
||||
static async create(action) {
|
||||
|
||||
// Actions are made unique by using a query that can be reproducable, i.e.,
|
||||
// not containing user inputable values.
|
||||
|
||||
@@ -280,7 +280,7 @@ module.exports = class CommentsService {
|
||||
* @return {Promise}
|
||||
*/
|
||||
static addAction(item_id, user_id, action_type, metadata = {}) {
|
||||
return ActionsService.insertUserAction({
|
||||
return ActionsService.create({
|
||||
item_id,
|
||||
item_type: 'COMMENTS',
|
||||
user_id,
|
||||
@@ -301,7 +301,7 @@ const incrActionCounts = async (action, value) => {
|
||||
[`action_counts.${ACTION_TYPE}`]: value,
|
||||
};
|
||||
|
||||
if (action.group_id !== null && action.group_id.length > 0) {
|
||||
if (action.group_id && action.group_id.length > 0) {
|
||||
const GROUP_ID = sc(action.group_id.toLowerCase());
|
||||
|
||||
update[`action_counts.${ACTION_TYPE}_${GROUP_ID}`] = value;
|
||||
|
||||
+1
-1
@@ -737,7 +737,7 @@ module.exports = class UsersService {
|
||||
* @return {Promise}
|
||||
*/
|
||||
static addAction(item_id, user_id, action_type, metadata) {
|
||||
return ActionsService.insertUserAction({
|
||||
return ActionsService.create({
|
||||
item_id,
|
||||
item_type: 'users',
|
||||
user_id,
|
||||
|
||||
Reference in New Issue
Block a user