Skip to content

Show "seen by X members" on task card 馃憖聽#579

Description

@anoopcodehack

Show "seen by X members" on task card 馃憖

File: server/models/Task.js + TaskCard.jsx

No way to know if teammates
have seen a task 馃拃 fr!!

Fix: add seenBy to Task model:
seenBy: [{
type: mongoose.Schema.Types.ObjectId,
ref: 'User'
}]

// in routes/tasks.js GET single task:
if (!task.seenBy.includes(req.user._id)) {
task.seenBy.push(req.user._id)
await task.save()
}

// show on card:
{task.seenBy?.length > 0 && (

馃憖 {task.seenBy.length} seen

)}

~10 lines! 馃幆

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions