-
Notifications
You must be signed in to change notification settings - Fork 968
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5291 from Countly/SER-1160-make-the-countly-guide…
…s-icons-stand-out-until-the-first-use [SER-1160] make the countly guides icons stand out until first use
- Loading branch information
Showing
10 changed files
with
148 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
var plugin = {}; | ||
const countlyConfig = require('../../../frontend/express/config'); | ||
const common = require('../../../api/utils/common.js'); | ||
|
||
plugin.init = function(/*app, countlyDb*/) { | ||
//add middleware here | ||
plugin.init = function(app) { | ||
app.post(countlyConfig.path + '/guides/viewed', function(req, res) { | ||
if (!req.session || !req.session.uid) { | ||
res.send(false); | ||
res.end(); | ||
return false; | ||
} | ||
else { | ||
var db = common.db, | ||
user_id = req.body.user_id, | ||
update = {"viewedGuides": true}; | ||
|
||
db.collection("members").update({ _id: db.ObjectID(user_id) }, { $set: update }, { upsert: true }, function(err, res2) { | ||
if (err) { | ||
common.returnMessage(err, 503, 'Failed to update member'); | ||
} | ||
else { | ||
common.returnMessage(res2, 200, 'Succesfuly updated member'); | ||
} | ||
}); | ||
} | ||
}); | ||
}; | ||
|
||
module.exports = plugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters