fix: Mobile QA — manual tasks + remittance data unwrap bug (FIBEROPS-207-208) #1

Merged
kibin merged 1 commits from fix/FIBEROPS-207-208-mobile-qa into main 2026-04-01 01:02:53 +00:00
3 changed files with 4 additions and 4 deletions
Showing only changes of commit 7d82ddc316 - Show all commits

View File

@@ -61,7 +61,7 @@ export default function ManualTaskDetailScreen() {
const { data: task, isLoading, refetch } = useQuery({ const { data: task, isLoading, refetch } = useQuery({
queryKey: ['manual-task', id], queryKey: ['manual-task', id],
queryFn: () => api.get(`/api/v1/manual-tasks/${id}`).then(r => r.data), queryFn: () => api.get(`/api/v1/manual-tasks/${id}`).then(r => r.data?.data ?? r.data),
staleTime: 0, staleTime: 0,
}); });

View File

@@ -25,7 +25,7 @@ export default function RemittanceDetailScreen() {
const { data, isLoading } = useQuery({ const { data, isLoading } = useQuery({
queryKey: ['remittance', id], queryKey: ['remittance', id],
queryFn: () => api.get(`/api/v1/remittances/${id}`).then(r => r.data), queryFn: () => api.get(`/api/v1/remittances/${id}`).then(r => r.data?.data ?? r.data),
}); });
if (isLoading) { if (isLoading) {

View File

@@ -11,7 +11,7 @@ export const api = axios.create({
}); });
api.interceptors.request.use(async (config) => { api.interceptors.request.use(async (config) => {
const token = await SecureStore.getItemAsync('fiberops_token'); const token = await SecureStore.getItemAsync(STORAGE_KEYS.TOKEN);
if (token) { if (token) {
config.headers.Authorization = `Bearer ${token}`; config.headers.Authorization = `Bearer ${token}`;
} }
@@ -22,7 +22,7 @@ api.interceptors.response.use(
(response) => response, (response) => response,
async (error) => { async (error) => {
if (error.response?.status === 401) { if (error.response?.status === 401) {
await SecureStore.deleteItemAsync('fiberops_token'); await SecureStore.deleteItemAsync(STORAGE_KEYS.TOKEN);
await SecureStore.deleteItemAsync('fiberops_tenant'); await SecureStore.deleteItemAsync('fiberops_tenant');
} }
return Promise.reject(error); return Promise.reject(error);