Commit 287f9033 authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

질문수정확인, 홈화면 이미지

parent 343e8706
...@@ -19,7 +19,7 @@ export const AEssayForm = ({ element, answerQuestion }: AnswerProps) => { ...@@ -19,7 +19,7 @@ export const AEssayForm = ({ element, answerQuestion }: AnswerProps) => {
<div className="flex mt-3 w-full justify-center"> <div className="flex mt-3 w-full justify-center">
<input <input
type="text" type="text"
className="border w-11/12 h-36 my-3" className="border w-11/12 h-24 my-3"
id={element._id} id={element._id}
onChange={handleChange} onChange={handleChange}
value={answer} value={answer}
......
import React, { FormEvent } from "react"; import React, { FormEvent } from "react";
import { useAuth } from "../auth/auth.context"; import { useAuth } from "../auth/auth.context";
import SurveyImg from "../icons/surveyimg.png"; import homeImg from "../icons/homeImg.png";
export const Home = () => { export const Home = () => {
const { user } = useAuth(); const { user } = useAuth();
...@@ -30,10 +30,10 @@ export const Home = () => { ...@@ -30,10 +30,10 @@ export const Home = () => {
+ +
</button> </button>
</div> </div>
<p className="text-center text-xl text-black mt-3">Create now!</p> <p className="text-center text-xl text-black my-3">Create now!</p>
</div> </div>
<div className="flex justify-center mt-3"> <div className="flex mt-5 md:px-48 bg-themeColor">
<img src={SurveyImg} className="object-scale-down justify-center" /> <img src={homeImg} className="m-3" />
</div> </div>
</div> </div>
); );
......
...@@ -77,6 +77,10 @@ export const CreateSurvey = () => { ...@@ -77,6 +77,10 @@ export const CreateSurvey = () => {
async function handleSubmit(event: FormEvent) { async function handleSubmit(event: FormEvent) {
event.preventDefault(); event.preventDefault();
const notEditComplete = isEditing?.find((el) => el.isEditing);
if (notEditComplete) {
alert("아직 수정이 완료되지 않은 질문이 존재합니다.");
} else {
try { try {
const newSurvey: SurveyType = await surveyApi.editSurvey(survey); const newSurvey: SurveyType = await surveyApi.editSurvey(survey);
console.log(newSurvey); console.log(newSurvey);
...@@ -90,6 +94,7 @@ export const CreateSurvey = () => { ...@@ -90,6 +94,7 @@ export const CreateSurvey = () => {
setLoading(false); setLoading(false);
} }
} }
}
async function addQuestion() { async function addQuestion() {
try { try {
......
...@@ -79,6 +79,10 @@ export const EditSurvey = () => { ...@@ -79,6 +79,10 @@ export const EditSurvey = () => {
async function handleSubmit(event: FormEvent) { async function handleSubmit(event: FormEvent) {
event.preventDefault(); event.preventDefault();
const notEditComplete = isEditing?.find((el) => el.isEditing);
if (notEditComplete) {
alert("아직 수정이 완료되지 않은 질문이 존재합니다.");
} else {
try { try {
const newSurvey: SurveyType = await surveyApi.editSurvey(survey); const newSurvey: SurveyType = await surveyApi.editSurvey(survey);
console.log(newSurvey); console.log(newSurvey);
...@@ -92,6 +96,7 @@ export const EditSurvey = () => { ...@@ -92,6 +96,7 @@ export const EditSurvey = () => {
setLoading(false); setLoading(false);
} }
} }
}
async function addQuestion() { async function addQuestion() {
try { try {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment