refactor: bot email

This commit is contained in:
Tristan Yang
2023-05-04 06:58:30 +08:00
parent a5deb17f76
commit 59672227de
+3 -1
View File
@@ -6,6 +6,7 @@ import Modal from '../../../common/component/Modal';
import Button from '../../../common/component/styled/Button'; import Button from '../../../common/component/styled/Button';
import Input from '../../../common/component/styled/Input'; import Input from '../../../common/component/styled/Input';
import StyledModal from '../../../common/component/styled/Modal'; import StyledModal from '../../../common/component/styled/Modal';
import { BASE_ORIGIN } from '../../../app/config';
type Props = { type Props = {
closeModal: () => void closeModal: () => void
@@ -35,11 +36,12 @@ const CreateModal = ({ closeModal }: Props) => {
formDataObj[key] = value; formDataObj[key] = value;
} }
}); });
const hostname = new URL(BASE_ORIGIN).hostname;
createUser({ createUser({
is_bot: true, is_bot: true,
is_admin: false, is_admin: false,
gender: 1, gender: 1,
email: `bot_${new Date().getTime()}@voce.chat`, email: `bot_${new Date().getTime()}@${hostname}`,
password: "", password: "",
...formDataObj ...formDataObj
}); });