Skip to content

Commit

Permalink
fix acceptance terms params (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-babylonlabs authored Oct 28, 2024
1 parent ab2c644 commit 8c5ab7a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/app/api/postLogTermAcceptance.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import { encode } from "url-safe-base64";

import { apiWrapper } from "./apiWrapper";

interface TermsPayload {
address: string;
publicKey: string;
public_key: string;
}

// postLogTermsAcceptance is used to log the terms acceptance for a given address and public key
export const postLogTermsAcceptance = async ({
address,
publicKey,
public_key,
}: TermsPayload) => {
const payload: TermsPayload = {
address: address,
publicKey: publicKey,
public_key: encode(public_key),
};

const response = await apiWrapper(
Expand Down
6 changes: 3 additions & 3 deletions src/app/hooks/useAcceptTerms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ export const useTermsAcceptance = () => {

const logTermsAcceptance = async ({
address,
publicKey,
public_key,
}: {
address: string;
publicKey: string;
public_key: string;
}) => {
await mutation.mutateAsync({ address, publicKey });
await mutation.mutateAsync({ address, public_key });
};

return { logTermsAcceptance };
Expand Down
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ const Home: React.FC<HomeProps> = () => {
// Log the terms acceptance
logTermsAcceptance({
address,
publicKey: publicKeyNoCoord.toString("hex"),
public_key: publicKeyNoCoord.toString("hex"),
});
} catch (error: Error | any) {
if (
Expand Down

0 comments on commit 8c5ab7a

Please sign in to comment.