Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: QA #77

Merged
merged 2 commits into from
Apr 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion components/CheckListComponent/ButtonsOfTypeA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ function ButtonsOfTypeA({ isEdit, checkList, setCheckLists, checkLists }: IProps
},
],
});
console.log(checkListContext?.choseCheckListByServer);
};

return (
Expand Down
1 change: 0 additions & 1 deletion components/CheckListComponent/ButtonsOfTypeB.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ function ButtonsOfTypeB({ isEdit, checkList, setCheckLists, checkLists }: IProps
},
],
});
console.log(checkListContext?.choseCheckListByServer);
setNewCheckListElement('');
};

Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { name as appName } from './app.json';

// default
axios.defaults.baseURL = 'http://3.38.93.184:8080';

axios.defaults.withCredentials = true;
axios.defaults.headers.post['Content-Type'] = 'application/json';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ const Tab = createMaterialTopTabNavigator();
interface IProps {
setIsEdit: Dispatch<SetStateAction<boolean>>;
isEdit: boolean;
onSubmitHandler: () => void;
}

function BasicCheckList({ setIsEdit, isEdit }: IProps) {
function BasicCheckList({ setIsEdit, isEdit, onSubmitHandler }: IProps) {
const [isBottomSheet, setIsBottomSheet] = useState(true);
const [onModal, setOnModal] = useState(false);
const onEditHandler = () => {
Expand All @@ -27,6 +28,10 @@ function BasicCheckList({ setIsEdit, isEdit }: IProps) {
setOnModal(!onModal);
};

setInterval(() => {
onSubmitHandler();
}, 100000);

return (
<>
<Tab.Navigator
Expand Down
22 changes: 14 additions & 8 deletions navigation/Main/StackNavigation/StackNavigationOfCheckList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Dispatch, SetStateAction, useContext, useState } from 'react';
import { Image, Pressable, Share } from 'react-native';

import BasicCheckList from './BasicCheckList/BasiclCheckList';
import { CheckListStackParamsList, CheckListStackProps } from '../../../types/navigationTypes';
import { CheckListStackParamsList } from '../../../types/navigationTypes';
import styles from './styles';
import ProfileSetting from '../../../screens/ProfileSetting/ProfileSetting';
import { mainLightBlue } from '../../../color';
Expand All @@ -29,7 +29,7 @@ function CheckListStackNav({ setIsLogin }: IProps) {
const onShare = async () => {
try {
const result = await Share.share({
message: 'https://www.naver.com',
message: `https://amattang.netlify.app/${checkListContext?.checkListId}`,
});
if (result.action === Share.sharedAction) {
if (result.activityType) {
Expand All @@ -46,26 +46,26 @@ function CheckListStackNav({ setIsLogin }: IProps) {
};

const onSubmitHandler = async () => {
await axios
axios
.put(
`/api/check-list/${checkListContext?.checkListId}/common/question/status`,
checkListContext?.deletedCheckListByServer
)
.then(() => checkListContext?.setDeletedCheckListByServer({ question: [] }));

await axios
axios
.put(
`/api/check-list/${checkListContext?.checkListId}/common/question`,
checkListContext?.choseCheckListByServer
)
.then(() =>
.then(() => {
checkListContext?.setChoseCheckListByServer({
typeA: [],
typeB: [],
typeD: [],
typeM: {},
})
);
});
});

setIsEdit(false);
};
Expand Down Expand Up @@ -99,7 +99,13 @@ function CheckListStackNav({ setIsLogin }: IProps) {
/>
<NativeStack.Screen
name="basicCheckList"
children={() => <BasicCheckList isEdit={isEdit} setIsEdit={setIsEdit} />}
children={() => (
<BasicCheckList
isEdit={isEdit}
setIsEdit={setIsEdit}
onSubmitHandler={onSubmitHandler}
/>
)}
options={() => ({
animationTypeForReplace: 'pop',
animation: 'slide_from_bottom',
Expand Down
1 change: 1 addition & 0 deletions screens/BasicCheckList/BasicInfoOfBasicCheckList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function BasicInfoOfBasicCheckList({ isEdit, setIsBottomSheet }: IProps) {
const [checkListSummary, setCheckListSummary] = useState<any>({});

const getServerData = async () => {
console.log(checkListContext?.checkListId);
try {
const serverResponse = await axios.get(
`/api/check-list/${checkListContext?.checkListId}/common?mainCategory=기본정보`
Expand Down
2 changes: 1 addition & 1 deletion screens/bottomTab/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function Home() {

useEffect(() => {
getHomeDataHandler();
});
}, []);

return (
<>
Expand Down