@@ -205,7 +205,10 @@ const seenChat = async (req, res, next) => {
seen: total,
watched: false,
});
- await ChatModel.update(isCompanionChat._id, id, { watched: true });
+ await ChatModel.update(isCompanionChat._id, id, {
+ watched: true,
+ seenCompanion: total,
+ });
return res.status(200).json({
status: 'success',
code: 200,
@@ -58,6 +58,10 @@ const chatSchema = new Schema(
type: Number,
default: 0,
},
+ seenCompanion: {
+ type: Number,
+ default: 0,
+ },
sort: {
type: Boolean,
default: false,