Merge pull request 'fix: Mobile QA — manual tasks + remittance data unwrap bug (FIBEROPS-207-208)' (#1) from fix/FIBEROPS-207-208-mobile-qa into main
This commit was merged in pull request #1.
This commit is contained in:
@@ -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,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user