Skip to content

Commit

Permalink
fix: QA
Browse files Browse the repository at this point in the history
QA진행 및 공유 URL 수정
#70
  • Loading branch information
11t518s committed Apr 2, 2022
1 parent d9c1118 commit ba68485
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
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
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

0 comments on commit ba68485

Please sign in to comment.