kjdskjdsk
This commit is contained in:
@@ -83,6 +83,21 @@ export async function deleteDeck(apiBase: string, id: string): Promise<void> {
|
||||
})
|
||||
}
|
||||
|
||||
export async function shareDeck(apiBase: string, id: string): Promise<string> {
|
||||
const { token } = await $fetch<{ token: string }>(
|
||||
`${apiBase}/me/decks/${encodeURIComponent(id)}/share`,
|
||||
{ method: 'POST', headers: authHeaders() },
|
||||
)
|
||||
return token
|
||||
}
|
||||
|
||||
export async function loadSharedDeck(apiBase: string, token: string): Promise<SavedDeck> {
|
||||
const { deck } = await $fetch<{ deck: SavedDeck }>(
|
||||
`${apiBase}/decks/share/${encodeURIComponent(token)}`,
|
||||
)
|
||||
return deck
|
||||
}
|
||||
|
||||
export function isBasicLand(card: DeckCard): boolean {
|
||||
return /\bbasic\b/i.test(card.typeLine) && /\bland\b/i.test(card.typeLine)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user