Board: Use for join action

Signed-off-by: Anna No <anna.no@xored.com>
This commit is contained in:
Anna No 2022-04-19 23:39:48 +07:00
parent 5b54ab7c46
commit 121b4abbda
No known key found for this signature in database
GPG Key ID: 08C11FFC23177C87

View File

@ -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 {