Skip to content

Commit

Permalink
Fix wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
danreeves committed Oct 12, 2023
1 parent e596277 commit 9052dc6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions app/routes/armoury.$character.$store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { authenticator } from "~/services/auth.server"
import {
getAccountSummary,
getCharacterStore,
getCharacterWallet,
getAccountWallet,
purchaseItem,
} from "~/services/darktide.server"
import { getSearchParam } from "~/utils/getSearchParam"
Expand Down Expand Up @@ -83,7 +83,7 @@ export async function action({ params, request }: ActionArgs) {
return json({ error: "Couldn't fetch store" })
}

let wallet = await getCharacterWallet(auth, currentCharacter.id)
let wallet = await getAccountWallet(auth)
if (!wallet) {
return json({ error: "Couldn't fetch wallet" })
}
Expand Down Expand Up @@ -163,7 +163,7 @@ export async function loader({ request, params }: LoaderArgs) {
getItems(WeaponSchema),
getItems(CurioSchema),
getItems(TraitSchema),
getCharacterWallet(auth, currentCharacter.id),
getAccountWallet(auth),
])

if (!currentShop) {
Expand Down Expand Up @@ -336,7 +336,7 @@ export default function Exchange() {
<div className="grid items-center gap-1.5">
<Label>Item type</Label>
<div className="flex gap-4">
{["melee", "ranged", "curio"].map((kind) => (
{["melee", "ranged", "gadget"].map((kind) => (
<div key={kind} className="flex items-center space-x-2 h-10">
<Checkbox id={kind} name="type" value={kind} />
<label
Expand All @@ -352,9 +352,9 @@ export default function Exchange() {

<div className="grid items-center gap-1.5">
<Label htmlFor="sort">Sort by</Label>
<Select name="sort" defaultValue="">
<Select name="sort" defaultValue="baseItemLevel">
<SelectTrigger className="w-[180px]">
<SelectValue placeholder="Any" />
<SelectValue placeholder="Base Rating" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
Expand Down
4 changes: 2 additions & 2 deletions app/routes/armoury.$character.contracts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
completeCharacterContract,
deleteCharacterTask,
getCharacterContracts,
getCharacterWallet,
getAccountWallet,
} from "~/services/darktide.server"
import { twMerge } from "tailwind-merge"

Expand Down Expand Up @@ -78,7 +78,7 @@ export async function loader({ params, request }: LoaderArgs) {

let [contract, wallet] = await Promise.all([
getCharacterContracts(auth, characterId, true),
getCharacterWallet(auth, characterId),
getAccountWallet(auth),
])
if (!contract) {
return json(null)
Expand Down
4 changes: 2 additions & 2 deletions app/services/darktide.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ let CharacterWalletSchema = z
}
})

export async function getCharacterWallet(auth: AuthToken, characterId: string) {
let url = `https://bsp-td-prod.atoma.cloud/data/${auth.sub}/characters/${characterId}/wallets`
export async function getAccountWallet(auth: AuthToken) {
let url = `https://bsp-td-prod.atoma.cloud/data/${auth.sub}/account/wallets`

let response = await fetch(url, {
headers: {
Expand Down

0 comments on commit 9052dc6

Please sign in to comment.