mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-23 22:12:44 +03:00
Merge pull request #1458 from hcengineering/ano/use-push-action-on-join
Board: Use $push for join action
This commit is contained in:
commit
c24a27c2ba
@ -40,14 +40,12 @@ export function hasDate (card: Card): boolean {
|
||||
|
||||
export function addCurrentUser (card: Card, client: Client): void {
|
||||
const employee = (getCurrentAccount() as EmployeeAccount).employee
|
||||
const members = card.members ?? []
|
||||
|
||||
if (members.includes(employee)) {
|
||||
if (card.members?.includes(employee)) {
|
||||
return
|
||||
}
|
||||
|
||||
members.push(employee)
|
||||
updateCard(client, card, 'members', members)
|
||||
client.update(card, { $push: { members: employee } })
|
||||
}
|
||||
|
||||
export function archiveCard (card: Card, client: Client): void {
|
||||
|
Loading…
Reference in New Issue
Block a user