-
카테고리
-
세부 분야
프론트엔드
-
해결 여부
해결됨
api/workspaces POST요청시 500에러가 뜹니다.
23.04.24 13:13 작성 23.04.24 13:14 수정 조회수 676
0
const onCreateWorkspace = useCallback(
(e: any) => {
e.preventDefault();
if (!newWorkspace || !newWorkspace.trim()) return; // trim : 앞 뒤 공백제거
if (!newUrl || !newUrl.trim()) return;
axios
.post(
'http://localhost:3095/api/workspaces',
{
Workspace: newWorkspace,
url: newUrl,
}, {
withCredentials: true
},
)
.then(() => {
mutate(userData, true);
setShowCreateWorkspaceModal(false);
setNewWorkspace('');
setNewUrl('');
})
.catch((error) => {
console.dir(error);
toast.error(error.response?.data, { position: 'bottom-center' });
});
},
[newWorkspace, newUrl],
);
뭐가 문제인건가요?
답변을 작성해보세요.
0
0
roider2316
질문자2023.04.24
터미널에 SequelizeValidationError: notNull Violation: Workspace.name cannot be null 에러가 떴었고 잘 찾아보니깐 대소문자 문제였네요. 감사합니다.
답변 2