Skip to content

hotfix: qa 10/01 #99

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

Merged
merged 7 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
4 changes: 3 additions & 1 deletion packages/react-native/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const queryClient = new QueryClient({
},
mutations: {
onError: (err) => {
Sentry.captureException(err);
if (!__DEV__) {
Sentry.captureException(err);
}
Alert.alert('오류가 발생했어요', '잠시뒤에 시도해보세요.');
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { useRef } from 'react';
import { useMutation } from '@tanstack/react-query';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { City, Region } from '@/constants/CITY';
import useAuthAxios from '../useAuthAxios';
import { ServerResponse } from '@/types/response';
import QUERY_KEYS from '@/constants/QUERY_KEYS';

interface QuizSubmitRequestParams {
id: number;
Expand All @@ -26,6 +27,7 @@ interface UseQuizSubmitMutationReturns {
export default function useQuizSubmitMutation() {
const ref = useRef({} as UseQuizSubmitMutationReturns);
const authAxios = useAuthAxios();
const queryClient = useQueryClient();

const submitAnswer = async ({ answer, id }: QuizSubmitRequestParams) => {
const result = await authAxios.post<ServerResponse<QuizSubmitResponse>>(
Expand All @@ -36,6 +38,9 @@ export default function useQuizSubmitMutation() {

const { mutateAsync, isPending } = useMutation({
mutationFn: submitAnswer,
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.MY_BADGES] });
},
});

ref.current.submitQuiz = mutateAsync;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import QUERY_KEYS from '@/constants/QUERY_KEYS';
import useAuthAxios from '@/apis/useAuthAxios';
import { City, Region } from '@/constants/CITY';
import { ServerResponse } from '@/types/response';
import removeHTMLTag from '@/utils/removeHTMLTag';

interface DetailResponse {
contentId: string;
Expand Down Expand Up @@ -35,8 +36,8 @@ export default function useDetailQuery({
`/api/spot/${id}?workId=${workId}`,
);
const originOverview = result.data.result.overview;
result.data.result.overview = originOverview.replace('<br>', '');
result.data.result.overview = originOverview.replace('</br>', '');
result.data.result.overview = removeHTMLTag(originOverview);

return result.data.result;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useQuery } from '@tanstack/react-query';
import QUERY_KEYS from '@/constants/QUERY_KEYS';
import useAuthAxios from '@/apis/useAuthAxios';
import { ServerResponse } from '@/types/response';
import removeHTMLTag from '@/utils/removeHTMLTag';

interface UseSpotDetailQueryParams {
id?: number;
Expand Down Expand Up @@ -31,6 +32,8 @@ export default function useSpotDetailQuery({ id }: UseSpotDetailQueryParams) {
const result = await authAxios.get<ServerResponse<SpotResponse>>(
`/api/around/${spotId}`,
);
const originOverview = result.data.result.overview;
result.data.result.overview = removeHTMLTag(originOverview);

return result.data.result;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ImageSelect from '../common/ImageSelect';
import useGallery from '@/hooks/useGallery';
import useAddTripPlan from '@/apis/mutations/useAddTripPlan';
import { getDateString } from '@/utils/date';
import MutationLoadingModal from '../common/MutationLoadingModal';

export default function TripPlanPostForm() {
const {
Expand All @@ -21,7 +22,7 @@ export default function TripPlanPostForm() {
setDate,
validate,
} = useTripPlanFormState();
const { mutate } = useAddTripPlan();
const { mutate, isPending } = useAddTripPlan();

const { getPhoto } = useGallery();

Expand All @@ -47,6 +48,7 @@ export default function TripPlanPostForm() {

return (
<View className="flex flex-col flex-1 p-4 justify-between">
<MutationLoadingModal isSubmiting={isPending} />
<View className="flex flex-col gap-4">
<View>
<RegionSelect />
Expand Down
2 changes: 2 additions & 0 deletions packages/react-native/src/constants/CITY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export enum City {
SANGJU,
MUNGYEONG,
GYEONGSAN,
GUNWI,
UISEONG,
CHEONGSONG,
YEONGYANG,
Expand Down Expand Up @@ -273,6 +274,7 @@ export const REGION = {
상주: City.SANGJU,
문경: City.MUNGYEONG,
경산: City.GYEONGSAN,
군위: City.GUNWI,
의성: City.UISEONG,
청송: City.CHEONGSONG,
영양: City.YEONGYANG,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function AddSchedule() {
{spotList.attraction.length > 0 && (
<>
<Font.Bold type="body1" color="white">
나의 SPOT!
담은 관광지
</Font.Bold>
<Spacing height={15} />
</>
Expand Down
3 changes: 3 additions & 0 deletions packages/react-native/src/utils/removeHTMLTag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function removeHTMLTag(content: string) {
return content.replace('<br>', '').replace('</br>', '').replace('<br />', '');
}
Loading