motorin along
This commit is contained in:
@@ -1,18 +1,20 @@
|
||||
import { Input, message } from 'antd'
|
||||
import { useForm } from 'antd/lib/form/Form'
|
||||
import FormItem from 'antd/lib/form/FormItem'
|
||||
import axios from 'axios'
|
||||
import { useAppContext } from '../../contexts/AppContext'
|
||||
import { Button } from '../../elements/Button'
|
||||
import { Form } from '../../elements/Form'
|
||||
import { User } from '../../types'
|
||||
|
||||
type NewUserForm = Omit<User, 'id'> & {
|
||||
type NewUserForm = {
|
||||
username: string
|
||||
email: string
|
||||
password1: string
|
||||
password2: string
|
||||
}
|
||||
|
||||
export const NewUser = () => {
|
||||
const api = useAppContext()
|
||||
const { baseURL } = useAppContext()
|
||||
const [form] = useForm<NewUserForm>()
|
||||
|
||||
const handleFinish = (user: NewUserForm) => {
|
||||
@@ -21,7 +23,7 @@ export const NewUser = () => {
|
||||
return
|
||||
}
|
||||
|
||||
api.post(`/dj-rest-auth/registration`, user)
|
||||
axios.post(`${baseURL}/dj-rest-auth/registration/`, user)
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -29,11 +31,11 @@ export const NewUser = () => {
|
||||
<FormItem label="username" name="username">
|
||||
<Input></Input>
|
||||
</FormItem>
|
||||
<FormItem label="email" name="email">
|
||||
{/* <FormItem label="email" name="email">
|
||||
<Input type="email"></Input>
|
||||
</FormItem>
|
||||
</FormItem> */}
|
||||
<FormItem label="password" name="password1">
|
||||
<Input minLength={8}></Input>
|
||||
<Input minLength={6}></Input>
|
||||
</FormItem>
|
||||
<FormItem label="confirm" name="password2">
|
||||
<Input></Input>
|
||||
|
||||
Reference in New Issue
Block a user