Skip to content

Commit

Permalink
feat: view record add splitMergeRecord (#623)
Browse files Browse the repository at this point in the history
Co-authored-by: onePone <pwang31@trip.com>
  • Loading branch information
1pone and Xremn authored Feb 7, 2024
1 parent a737cdc commit 39ec9ba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ const ReplayCaseDetail: ArexPaneFC<ReplayCaseDetailData> = (props) => {
}, [activePane?.id]);

const { loading } = useRequest(ReportService.viewRecord, {
defaultParams: [
{
recordId: props.data.recordId,
},
],
defaultParams: [props.data.recordId],
onSuccess(res) {
const resultMap = res.recordResult.reduce<Map<string, RecordResult[]>>((map, cur) => {
const { categoryType } = cur;
Expand Down
26 changes: 15 additions & 11 deletions packages/arex/src/services/ReportService/viewRecord.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { getLocalStorage, tryParseJsonString, tryStringifyJson } from '@arextest/arex-core';
import { getLocalStorage, tryParseJsonString } from '@arextest/arex-core';
import axios from 'axios';

import { ACCESS_TOKEN_KEY, APP_ID_KEY } from '@/constant';

export type ViewRecordReq = {
recordId: string;
};
export interface CategoryType {
name: string;
entryPoint: boolean;
Expand Down Expand Up @@ -52,13 +49,20 @@ export interface ViewRecordRes {
desensitized: boolean;
}

export async function viewRecord(params: ViewRecordReq) {
const res = await axios.post<ViewRecordRes>('/webApi/replay/query/viewRecord', params, {
headers: {
'access-token': getLocalStorage<string>(ACCESS_TOKEN_KEY),
appId: getLocalStorage<string>(APP_ID_KEY),
export async function viewRecord(recordId: string) {
const res = await axios.post<ViewRecordRes>(
'/webApi/replay/query/viewRecord',
{
recordId,
splitMergeRecord: true,
},
{
headers: {
'access-token': getLocalStorage<string>(ACCESS_TOKEN_KEY),
appId: getLocalStorage<string>(APP_ID_KEY),
},
transformResponse: (res) => tryParseJsonString(res),
},
transformResponse: (res) => tryParseJsonString(res),
});
);
return Promise.resolve(res.data);
}
1 change: 1 addition & 0 deletions packages/arex/src/services/StorageService/queryRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export async function queryRecord(recordId: string) {
'/storage/storage/replay/query/viewRecord',
{
recordId,
splitMergeRecord: true,
sourceProvider: 'Pinned',
},
{
Expand Down

0 comments on commit 39ec9ba

Please sign in to comment.