completed p-account-auth api&spa

このコミットが含まれているのは:
dragon1211 2021-11-11 00:03:05 +09:00
コミット 57492b6e9f
3個のファイルの変更199行の追加258行の削除

ファイルの表示

@ -46461,11 +46461,12 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router */ "./node_modules/react-router/esm/react-router.js");
/* harmony import */ var _material_ui_lab__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @material-ui/lab */ "./node_modules/@material-ui/lab/LoadingButton/LoadingButton.js");
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-router */ "./node_modules/react-router/esm/react-router.js");
/* harmony import */ var _material_ui_lab__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @material-ui/lab */ "./node_modules/@material-ui/lab/LoadingButton/LoadingButton.js");
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
/* harmony import */ var _component_alert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../component/alert */ "./resources/js/component/alert.jsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@ -46485,8 +46486,9 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var ParentForgotPasswordReset = function ParentForgotPasswordReset(props) {
var history = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useHistory)();
var history = (0,react_router__WEBPACK_IMPORTED_MODULE_4__.useHistory)();
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
_useState2 = _slicedToArray(_useState, 2),
@ -46527,17 +46529,17 @@ var ParentForgotPasswordReset = function ParentForgotPasswordReset(props) {
setSubmit(true);
var req = {
password: password,
password_confirmation: password,
password_confirmation: password_confirmation,
token: (_props$match$params = props.match.params) === null || _props$match$params === void 0 ? void 0 : _props$match$params.token
};
axios__WEBPACK_IMPORTED_MODULE_1___default().put('/api/children/updatePassword', req).then(function (response) {
axios__WEBPACK_IMPORTED_MODULE_1___default().put('/api/fathers/updatePassword', req).then(function (response) {
setSubmit(false);
switch (response.data.status_code) {
case 200:
{
history.push({
pathname: '/c-account/forgot-password/complete',
pathname: '/p-account/forgot-password/complete',
state: {}
});
break;
@ -46554,19 +46556,19 @@ var ParentForgotPasswordReset = function ParentForgotPasswordReset(props) {
});
};
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("form", {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("form", {
onSubmit: handleSubmit,
noValidate: true,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
className: "pb-60-px text-center font-weight-bold ft-25",
children: "\u30D1\u30B9\u30EF\u30FC\u30C9\u518D\u767B\u9332"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
className: "edit-set",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("label", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("label", {
htmlFor: "password",
className: "control-label ft-14 ft-md-12",
children: "\u30D1\u30B9\u30EF\u30FC\u30C9"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("input", {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", {
type: "password",
name: "password",
id: "password",
@ -46576,17 +46578,17 @@ var ParentForgotPasswordReset = function ParentForgotPasswordReset(props) {
return setPassword(e.target.value);
},
autoFocus: true
}), _422errors.password && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
}), _422errors.password && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
className: "l-alert__text--error ft-16 ft-md-14",
children: _422errors.password
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
className: "edit-set",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("label", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("label", {
htmlFor: "password_confirmation",
className: "control-label ft-14 ft-md-12",
children: "\u78BA\u8A8D\u7528\u30D1\u30B9\u30EF\u30FC\u30C9"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("input", {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", {
type: "password",
name: "password_confirmation",
id: "password_confirmation",
@ -46595,23 +46597,23 @@ var ParentForgotPasswordReset = function ParentForgotPasswordReset(props) {
onChange: function onChange(e) {
return setPasswordConfirmation(e.target.value);
}
}), _422errors.password_confirmation && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
}), _422errors.password_confirmation && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
className: "l-alert__text--error ft-16 ft-md-14",
children: _422errors.password_confirmation
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
className: "mt-5",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_material_ui_lab__WEBPACK_IMPORTED_MODULE_4__.default, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_material_ui_lab__WEBPACK_IMPORTED_MODULE_5__.default, {
type: "submit",
loading: submit,
fullWidth: true,
className: "btn-edit btn-default btn-h60 bg-yellow rounded-20 py-5",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
className: "ft-16 font-weight-bold ".concat(!submit && 'text-black'),
children: "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u66F4\u65B0\u3059\u308B"
})
})
}), _400error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Alert, {
}), _400error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_component_alert__WEBPACK_IMPORTED_MODULE_2__.default, {
type: "fail",
hide: function hide() {
return set400Error('');
@ -47078,13 +47080,14 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router */ "./node_modules/react-router/esm/react-router.js");
/* harmony import */ var _material_ui_lab__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @material-ui/lab */ "./node_modules/@material-ui/lab/LoadingButton/LoadingButton.js");
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-router */ "./node_modules/react-router/esm/react-router.js");
/* harmony import */ var _material_ui_lab__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @material-ui/lab */ "./node_modules/@material-ui/lab/LoadingButton/LoadingButton.js");
/* harmony import */ var _material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @material-ui/core/IconButton */ "./node_modules/@material-ui/core/IconButton/IconButton.js");
/* harmony import */ var _mui_icons_material_PhotoCameraOutlined__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @mui/icons-material/PhotoCameraOutlined */ "./node_modules/@mui/icons-material/PhotoCameraOutlined.js");
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @material-ui/core/IconButton */ "./node_modules/@material-ui/core/IconButton/IconButton.js");
/* harmony import */ var _mui_icons_material_PhotoCameraOutlined__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @mui/icons-material/PhotoCameraOutlined */ "./node_modules/@mui/icons-material/PhotoCameraOutlined.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
/* harmony import */ var _component_alert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../component/alert */ "./resources/js/component/alert.jsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@ -47106,8 +47109,9 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var ParentSignUp = function ParentSignUp(props) {
var history = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useHistory)();
var history = (0,react_router__WEBPACK_IMPORTED_MODULE_4__.useHistory)();
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
_useState2 = _slicedToArray(_useState, 2),
@ -47116,80 +47120,69 @@ var ParentSignUp = function ParentSignUp(props) {
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),
_useState4 = _slicedToArray(_useState3, 2),
first_name = _useState4[0],
setFirstName = _useState4[1];
image = _useState4[0],
setImage = _useState4[1];
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),
_useState6 = _slicedToArray(_useState5, 2),
last_name = _useState6[0],
setLastName = _useState6[1];
company = _useState6[0],
setCompany = _useState6[1];
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),
_useState8 = _slicedToArray(_useState7, 2),
identity = _useState8[0],
setIdentity = _useState8[1];
password = _useState8[0],
setPassword = _useState8[1];
var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),
_useState10 = _slicedToArray(_useState9, 2),
email = _useState10[0],
setEmail = _useState10[1];
tel = _useState10[0],
setTel = _useState10[1];
var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),
_useState12 = _slicedToArray(_useState11, 2),
password = _useState12[0],
setPassword = _useState12[1];
profile = _useState12[0],
setProfile = _useState12[1];
var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),
var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
image: '',
company: '',
password: '',
tel: '',
profile: ''
}),
_useState14 = _slicedToArray(_useState13, 2),
company = _useState14[0],
setCompany = _useState14[1];
_422errors = _useState14[0],
set422Errors = _useState14[1];
var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),
_useState16 = _slicedToArray(_useState15, 2),
image = _useState16[0],
setImage = _useState16[1];
var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
first_name: '',
last_name: '',
identity: '',
email: '',
password: '',
image: '',
company: ''
}),
_useState18 = _slicedToArray(_useState17, 2),
_422errors = _useState18[0],
set422Errors = _useState18[1];
_400error = _useState16[0],
set400Error = _useState16[1];
var handleSubmit = function handleSubmit(e) {
e.preventDefault();
set422Errors({
first_name: '',
last_name: '',
identity: '',
email: '',
password: '',
image: '',
company: ''
company: '',
password: '',
tel: '',
profile: ''
});
setSubmit(true);
var formdata = new FormData();
formdata.append('first_name', first_name);
formdata.append('last_name', last_name);
formdata.append('identity', identity);
formdata.append('email', email);
formdata.append('password', password);
formdata.append('company', company);
formdata.append('image', image);
formdata.append('company', company);
formdata.append('password', password);
formdata.append('tel', tel);
formdata.append('profile', profile);
formdata.append('token', props.match.params.token);
axios__WEBPACK_IMPORTED_MODULE_1___default().post('/api/children/registerMain', formdata).then(function (response) {
axios__WEBPACK_IMPORTED_MODULE_1___default().post('/api/fathers/registerMain', formdata).then(function (response) {
setSubmit(false);
switch (response.data.status_code) {
case 200:
history.push({
pathname: '/c-account/register/complete/' + props.match.params.token,
pathname: '/p-account/register/complete/' + props.match.params.token,
state: {}
});
break;
@ -47199,8 +47192,12 @@ var ParentSignUp = function ParentSignUp(props) {
break;
case 400:
set400Error(response.data.error_messages);
break;
case 401:
history.push({
pathname: '/c-account/register/error/' + props.match.params.token,
pathname: '/p-account/register/error/' + props.match.params.token,
state: {}
});
break;
@ -47221,15 +47218,15 @@ var ParentSignUp = function ParentSignUp(props) {
};
};
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("form", {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("form", {
onSubmit: handleSubmit,
noValidate: true,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
className: "text-center font-weight-bold ft-25",
children: "\u672C\u767B\u9332"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
className: "mt-25-px",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("input", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", {
type: "file",
id: "avatar",
name: "avatar",
@ -47238,17 +47235,17 @@ var ParentSignUp = function ParentSignUp(props) {
onChange: function onChange(e) {
return handleImageChange(e);
}
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
className: "avatar-wrapper ".concat(_422errors.image && "is-invalid c-input__target"),
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("label", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("label", {
htmlFor: "avatar",
className: "avatar-label",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_4__.default, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_5__.default, {
color: "primary",
"aria-label": "upload picture",
component: "span",
className: "bg-yellow shadow-sm w-50-px h-50-px",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_mui_icons_material_PhotoCameraOutlined__WEBPACK_IMPORTED_MODULE_5__.default, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_mui_icons_material_PhotoCameraOutlined__WEBPACK_IMPORTED_MODULE_6__.default, {
style: {
width: '25px',
height: '25px',
@ -47256,117 +47253,22 @@ var ParentSignUp = function ParentSignUp(props) {
}
})
})
}), image && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("img", {
}), image && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("img", {
src: image,
className: "avatar-img",
alt: "avatar-img"
})]
}), _422errors.image && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
}), _422errors.image && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
className: "l-alert__text--error ft-16 ft-md-14",
children: _422errors.image
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
className: "edit-set",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("label", {
htmlFor: "first_name",
className: "control-label",
children: " \u59D3 "
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("input", {
type: "text",
name: "first_name",
id: "first_name",
className: "input-default input-nameSei input-h60 input-w480 ".concat(_422errors.first_name && "is-invalid c-input__target"),
value: first_name,
onChange: function onChange(e) {
return setFirstName(e.target.value);
}
}), _422errors.first_name && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
className: "l-alert__text--error ft-16 ft-md-14",
children: _422errors.first_name
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
className: "edit-set",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("label", {
htmlFor: "last_name",
className: "control-label",
children: " \u540D "
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("input", {
type: "text",
name: "last_name",
id: "last_name",
className: "input-default input-nameSei input-h60 input-w480 ".concat(_422errors.last_name && "is-invalid c-input__target"),
value: last_name,
onChange: function onChange(e) {
return setLastName(e.target.value);
}
}), _422errors.last_name && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
className: "l-alert__text--error ft-16 ft-md-14",
children: _422errors.last_name
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
className: "edit-set",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("label", {
htmlFor: "identity",
className: "control-label",
children: " ID "
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("input", {
type: "text",
name: "identity",
id: "identity",
className: "input-default input-nameSei input-h60 input-w480 ".concat(_422errors.identity && "is-invalid c-input__target"),
value: identity,
onChange: function onChange(e) {
return setIdentity(e.target.value);
}
}), _422errors.identity && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
className: "l-alert__text--error ft-16 ft-md-14",
children: _422errors.identity
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
className: "edit-set",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("label", {
htmlFor: "email",
className: "control-label",
children: " \u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9 "
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("input", {
type: "email",
name: "email",
id: "email",
className: "input-default input-nameSei input-h60 input-w480 ".concat(_422errors.email && "is-invalid c-input__target"),
value: email,
onChange: function onChange(e) {
return setEmail(e.target.value);
}
}), _422errors.email && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
className: "l-alert__text--error ft-16 ft-md-14",
children: _422errors.email
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
className: "edit-set",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("label", {
htmlFor: "password",
className: "control-label",
children: " \u30D1\u30B9\u30EF\u30FC\u30C9 "
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("input", {
type: "password",
name: "password",
id: "password",
className: "input-default input-nameSei input-h60 input-w480 ".concat(_422errors.password && "is-invalid c-input__target"),
value: password,
onChange: function onChange(e) {
return setPassword(e.target.value);
}
}), _422errors.password && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
className: "l-alert__text--error ft-16 ft-md-14",
children: _422errors.password
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
className: "edit-set",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("label", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("label", {
htmlFor: "company",
className: "control-label",
children: " \u6240\u5C48\u3057\u3066\u3044\u308B\u4F1A\u793E\u540D\u3092\u8A18\u8F09 "
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("input", {
children: " \u4F1A\u793E\u540D "
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", {
type: "text",
name: "company",
id: "company",
@ -47375,22 +47277,84 @@ var ParentSignUp = function ParentSignUp(props) {
onChange: function onChange(e) {
return setCompany(e.target.value);
}
}), _422errors.company && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
}), _422errors.company && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
className: "l-alert__text--error ft-16 ft-md-14",
children: _422errors.company
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
className: "edit-set",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("label", {
htmlFor: "password",
className: "control-label",
children: " \u30D1\u30B9\u30EF\u30FC\u30C9 "
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", {
type: "password",
name: "password",
id: "password",
className: "input-default input-nameSei input-h60 input-w480 ".concat(_422errors.password && "is-invalid c-input__target"),
value: password,
onChange: function onChange(e) {
return setPassword(e.target.value);
}
}), _422errors.password && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
className: "l-alert__text--error ft-16 ft-md-14",
children: _422errors.password
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
className: "edit-set",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("label", {
htmlFor: "tel",
className: "control-label",
children: " \u96FB\u8A71\u756A\u53F7 "
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("input", {
type: "text",
name: "tel",
id: "tel",
className: "input-default input-nameSei input-h60 input-w480 ".concat(_422errors.tel && "is-invalid c-input__target"),
value: tel,
onChange: function onChange(e) {
return setTel(e.target.value);
}
}), _422errors.tel && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
className: "l-alert__text--error ft-16 ft-md-14",
children: _422errors.tel
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
className: "edit-set",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("label", {
className: "control-label",
htmlFor: "profile",
children: " \u30D7\u30ED\u30D5\u30A3\u30FC\u30EB "
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("textarea", {
id: "profile",
value: profile,
onChange: function onChange(e) {
return setProfile(e.target.value);
},
rows: "8",
className: "textarea-default rounded-20 ".concat(_422errors.profile && 'is-invalid c-input__target', " ")
}), _422errors.profile && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
className: "l-alert__text--error ft-16 ft-md-14",
children: _422errors.profile
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
className: "mt-5",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_material_ui_lab__WEBPACK_IMPORTED_MODULE_6__.default, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_material_ui_lab__WEBPACK_IMPORTED_MODULE_7__.default, {
type: "submit",
fullWidth: true,
className: "btn-edit btn-default btn-h75 bg-yellow rounded-20",
loading: submit,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
className: "ft-16 font-weight-bold ".concat(!submit && 'text-black'),
children: "\u672C\u767B\u9332"
})
})
}), _400error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_component_alert__WEBPACK_IMPORTED_MODULE_2__.default, {
type: "fail",
hide: function hide() {
return set400Error('');
},
children: _400error
})]
});
};

ファイルの表示

@ -3,7 +3,7 @@ import { useHistory } from 'react-router';
import { LoadingButton } from '@material-ui/lab';
import axios from 'axios';
import Alert from '../../../component/alert';
const ParentForgotPasswordReset = (props) => {
@ -23,15 +23,15 @@ const ParentForgotPasswordReset = (props) => {
setSubmit(true);
let req = {
password: password,
password_confirmation: password,
password_confirmation: password_confirmation,
token: props.match.params?.token
}
axios.put('/api/children/updatePassword', req)
axios.put('/api/fathers/updatePassword', req)
.then(response => {
setSubmit(false);
switch(response.data.status_code){
case 200: {
history.push({pathname: '/c-account/forgot-password/complete', state: {}});
history.push({pathname: '/p-account/forgot-password/complete', state: {}});
break;
}
case 422: set422Errors(response.data.error_messages); break;

ファイルの表示

@ -1,63 +1,59 @@
import React, { useEffect, useState } from 'react';
import { useHistory } from 'react-router';
import { LoadingButton } from '@material-ui/lab';
import axios from 'axios';
import IconButton from "@material-ui/core/IconButton";
import PhotoCameraOutlinedIcon from '@mui/icons-material/PhotoCameraOutlined';
import axios from 'axios';
import Alert from '../../../component/alert';
const ParentSignUp = (props) => {
const history = useHistory();
const [submit, setSubmit] = useState(false);
const [first_name, setFirstName] = useState('');
const [last_name, setLastName] = useState('');
const [identity, setIdentity] = useState('');
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [company, setCompany] = useState('');
const [image, setImage] = useState('');
const [company, setCompany] = useState('');
const [password, setPassword] = useState('');
const [tel, setTel] = useState('');
const [profile, setProfile] = useState('');
const [_422errors, set422Errors] = useState({
first_name:'',
last_name:'',
identity:'',
email:'',
password:'',
image:'',
company:''
company:'',
password:'',
tel:'',
profile:'',
});
const [_400error, set400Error] = useState('');
const handleSubmit = (e) => {
e.preventDefault();
set422Errors({
first_name:'',
last_name:'',
identity:'',
email:'',
password:'',
image:'',
company:''
company:'',
password:'',
tel:'',
profile:'',
});
setSubmit(true);
const formdata = new FormData();
formdata.append('first_name', first_name);
formdata.append('last_name', last_name);
formdata.append('identity', identity);
formdata.append('email', email);
formdata.append('password', password);
formdata.append('company', company);
formdata.append('image', image);
formdata.append('company', company);
formdata.append('password', password);
formdata.append('tel', tel);
formdata.append('profile', profile);
formdata.append('token', props.match.params.token);
axios.post('/api/children/registerMain', formdata)
axios.post('/api/fathers/registerMain', formdata)
.then(response => {
setSubmit(false);
switch(response.data.status_code){
case 200: history.push({pathname: '/c-account/register/complete/'+props.match.params.token, state: {}}); break;
case 200: history.push({pathname: '/p-account/register/complete/'+props.match.params.token, state: {}}); break;
case 422: set422Errors(response.data.error_messages); break;
case 400: history.push({pathname: '/c-account/register/error/'+props.match.params.token, state: {}}); break;
case 400: set400Error(response.data.error_messages); break;
case 401: history.push({pathname: '/p-account/register/error/'+props.match.params.token, state: {}}); break;
};
})
}
@ -98,47 +94,14 @@ const ParentSignUp = (props) => {
</span>
}
</div>
<div className="edit-set">
<label htmlFor="first_name" className="control-label"> </label>
<input type="text" name="first_name" id="first_name" className={`input-default input-nameSei input-h60 input-w480 ${ _422errors.first_name && "is-invalid c-input__target" }`} value={first_name} onChange={e=>setFirstName(e.target.value)}/>
{
_422errors.first_name &&
<span className="l-alert__text--error ft-16 ft-md-14">
{ _422errors.first_name }
</span>
}
</div>
<div className="edit-set">
<label htmlFor="last_name" className="control-label"> </label>
<input type="text" name="last_name" id="last_name" className={`input-default input-nameSei input-h60 input-w480 ${ _422errors.last_name && "is-invalid c-input__target" }`} value={last_name} onChange={e=>setLastName(e.target.value)}/>
<label htmlFor="company" className="control-label"> 会社名 </label>
<input type="text" name="company" id="company" className = {`input-default input-nameSei input-h60 input-w480 ${ _422errors.company && "is-invalid c-input__target" }`} value={company} onChange={e=>setCompany(e.target.value)}/>
{
_422errors.last_name &&
_422errors.company &&
<span className="l-alert__text--error ft-16 ft-md-14">
{ _422errors.last_name }
</span>
}
</div>
<div className="edit-set">
<label htmlFor="identity" className="control-label"> ID </label>
<input type="text" name="identity" id="identity" className={`input-default input-nameSei input-h60 input-w480 ${ _422errors.identity && "is-invalid c-input__target" }`} value={identity} onChange={e=>setIdentity(e.target.value)}/>
{
_422errors.identity &&
<span className="l-alert__text--error ft-16 ft-md-14">
{ _422errors.identity }
</span>
}
</div>
<div className="edit-set">
<label htmlFor="email" className="control-label"> メールアドレス </label>
<input type="email" name="email" id="email" className = {`input-default input-nameSei input-h60 input-w480 ${ _422errors.email && "is-invalid c-input__target" }`} value={email} onChange={e=>setEmail(e.target.value)}/>
{
_422errors.email &&
<span className="l-alert__text--error ft-16 ft-md-14">
{ _422errors.email }
{ _422errors.company }
</span>
}
</div>
@ -153,15 +116,26 @@ const ParentSignUp = (props) => {
</span>
}
</div>
<div className="edit-set">
<label htmlFor="tel" className="control-label"> 電話番号 </label>
<input type="text" name="tel" id="tel" className={`input-default input-nameSei input-h60 input-w480 ${ _422errors.tel && "is-invalid c-input__target" }`} value={tel} onChange={e=>setTel(e.target.value)}/>
{
_422errors.tel &&
<span className="l-alert__text--error ft-16 ft-md-14">
{ _422errors.tel }
</span>
}
</div>
<div className="edit-set">
<label htmlFor="company" className="control-label"> 所屈している会社名を記載 </label>
<input type="text" name="company" id="company" className = {`input-default input-nameSei input-h60 input-w480 ${ _422errors.company && "is-invalid c-input__target" }`} value={company} onChange={e=>setCompany(e.target.value)}/>
<label className="control-label" htmlFor="profile"> プロフィール </label>
<textarea id="profile" value={ profile } onChange={e=>setProfile(e.target.value)} rows="8" className={`textarea-default rounded-20 ${ _422errors.profile && 'is-invalid c-input__target'} `}/>
{
_422errors.company &&
_422errors.profile &&
<span className="l-alert__text--error ft-16 ft-md-14">
{ _422errors.company }
</span>
{_422errors.profile}
</span>
}
</div>
@ -172,6 +146,9 @@ const ParentSignUp = (props) => {
<span className={`ft-16 font-weight-bold ${!submit && 'text-black'}`}>本登録</span>
</LoadingButton>
</div>
{
_400error && <Alert type="fail" hide={()=>set400Error('')}>{_400error}</Alert>
}
</form>
)
}