wip(org): Work on signup/signin pages
This commit is contained in:
parent
cb3614c109
commit
636feb877d
6 changed files with 240 additions and 12 deletions
23
sites/shared/backend.mjs
Normal file
23
sites/shared/backend.mjs
Normal file
|
@ -0,0 +1,23 @@
|
|||
import axios from 'axios'
|
||||
|
||||
/*
|
||||
* Helper methods to interact with the FreeSewing backend
|
||||
*/
|
||||
|
||||
const backend = axios.create({
|
||||
baseURL: process.env.NEXT_PUBLIC_BACKEND || 'https://backend.freesewing.org',
|
||||
timeout: 3000,
|
||||
})
|
||||
|
||||
export const signUp = async ({ email, language, startLoading, stopLoading }) => {
|
||||
let result
|
||||
try {
|
||||
startLoading()
|
||||
result = await backend.post('/signup', { email, language })
|
||||
} catch (err) {
|
||||
console.log({ err })
|
||||
} finally {
|
||||
if (result) console.log({ result })
|
||||
stopLoading()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue