Skip to content

Commit

Permalink
fix MarketUUID logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Dindb-dong committed Jan 13, 2025
1 parent d648d51 commit 0c248e8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/components/Auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
TextInput,
TouchableOpacity,
Alert,
Button,
} from 'react-native';
import { GREEN, PURPLE } from '../../styles/GlobalColor';
import { useState, Fragment, useContext } from 'react';
Expand All @@ -18,7 +19,8 @@ import {
setRefreshToken,
setUserRole,
getUserRole,
setMarketUUID
setMarketUUID,
removeAccessToken
} from '../../common/storage';
import { LoginContext, useUser } from '../../common/Context';

Expand Down Expand Up @@ -141,8 +143,8 @@ export async function processLoginResponse( // 통상 로그인시 호출 함수
try {
const response = await request.get(`/api/market`, {}, headers)
if (response.status && response.status === 200) {
setMarketUUID(response.data.market_uuid);
console.log('processLogin에서:', response.data.market_uuid)
setMarketUUID(response.data[0].market_uuid);
console.log('processLogin에서:', response.data[0].market_uuid)
} else {
console.log('processLogin에서 MarketUUID 저장 실패:', response);
}
Expand Down Expand Up @@ -254,6 +256,7 @@ export default function Login({ navigation, route }: LoginProps) {
<TouchableOpacity onPress={() => navigation.navigate('Signup')}>
<Caption11M style={{ color: '#ffffff' }}>회원가입</Caption11M>
</TouchableOpacity>
<Button title='test' onPress={() => { removeAccessToken }} />
{/* <Caption11M style={{ color: '#ffffff' }}> | </Caption11M>
<Caption11M style={{ color: '#ffffff' }}>비밀번호 찾기</Caption11M> */}
</View>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Auth/Reformer/ReformerMyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,13 @@ export const ReformerMyPageScreen = ({
// 본인 마켓 정보 가져오기: 링크, 자기소개, 닉네임, uuid
const response2 = await request.get(`/api/market`, {}, headers);
if (response2 && response2.status === 200) {
const marketResult: MarketResponseType = response2.data;
const marketResult: MarketResponseType = response2.data[0];
setMarketResponseData(marketResult);
const marketUUID = await getMarketUUID();
fetchMarketData({
market_introduce: marketResult.market_introduce,
market_thumbnail: marketResult.market_thumbnail || '', // 기본값 유지
market_uuid: marketUUID || '',
market_uuid: marketUUID || marketResult.market_uuid,
});
console.log('마켓 정보 가져오기 성공', response2.data);
try {
Expand Down
3 changes: 1 addition & 2 deletions src/components/Home/Market/Service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export type ServiceResponseType = {
service_category: string;
service_content: string;
service_image: any[];
service_option_images: any[];
service_material: any[];
service_option: any[];
service_period: number;
Expand Down Expand Up @@ -122,7 +121,7 @@ const EntireServiceMarket = ({
const response = await request.get(`/api/market/services`, {}, {});
if (response && response.status === 200) {
const serviceListResults: ServiceResponseType[] = response.data.results;
//console.log(serviceListResults);
console.log(serviceListResults[0].service_option);
setServiceCardRawData(serviceListResults);
const extractedServiceCardData = extractData(serviceListResults);
setServiceCardData(extractedServiceCardData);
Expand Down

0 comments on commit 0c248e8

Please sign in to comment.