Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/179 implement msw #205

Open
wants to merge 13 commits into
base: production
Choose a base branch
from
Prev Previous commit
Next Next commit
removed log statments
KrazyK786 committed Jun 16, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit c4862a6b6ad9dc9f5f5f630b730d36413f6f942b
6 changes: 1 addition & 5 deletions components/donateform.js
Original file line number Diff line number Diff line change
@@ -55,21 +55,17 @@ donate = async (ev) => {
let token
try {
const cardElement = this.props.elements.getElement(CardElement)
// const res = await this.props.stripe.createToken(cardElement);
console.log('cardElement: ', cardElement)
let res
if (process.env.STRIPE_PUBLIC_KEY === 'test') {
res = {
error: 'error',
error: 'error with test token ',
token: mockToken
}
} else {
res = await this.props.stripe.createToken(cardElement)
}

console.log('createToken res: ', res)
token = res.token
console.log('token: ', token)
} catch (e) {
this.setState({ error: e.message, loading: false })
return
5 changes: 0 additions & 5 deletions hooks/useAuth.js
Original file line number Diff line number Diff line change
@@ -12,11 +12,6 @@ export function useAuth () {
const { data: user, isValidating, revalidate, error } = useSWR('/api/account', fetcher)
const loading = (user === undefined || isValidating)

console.log(`Data being returned:
user: ${user},
isValidating: ${isValidating},
error: ${error}`)

return { user, loading, revalidate, error }
}