mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-21 15:59:15 +00: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 {
|
export function addCurrentUser (card: Card, client: Client): void {
|
||||||
const employee = (getCurrentAccount() as EmployeeAccount).employee
|
const employee = (getCurrentAccount() as EmployeeAccount).employee
|
||||||
const members = card.members ?? []
|
|
||||||
|
|
||||||
if (members.includes(employee)) {
|
if (card.members?.includes(employee)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
members.push(employee)
|
client.update(card, { $push: { members: employee } })
|
||||||
updateCard(client, card, 'members', members)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function archiveCard (card: Card, client: Client): void {
|
export function archiveCard (card: Card, client: Client): void {
|
||||||
|
Loading…
Reference in New Issue
Block a user