Skip to content

Commit

Permalink
update to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Nov 13, 2023
1 parent 199a10a commit 34a52a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/common/network/recycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ import { generateDatabaseSid, generateSessionSid } from './pathUtil';
* 获取回收站保留时间
*/
export async function getRecyleKeepTime() {
const res = await request.get(`/api/v1/recyclebin/getExpireTime/${generateSessionSid()}`);
const res = await request.get(`/api/v2/recyclebin/getExpireTime/${generateSessionSid()}`);
return res?.data;
}

export async function getRecycleConfig(sessionId: string): Promise<IRecycleConfig> {
const res = await request.get(`/api/v1/recyclebin/settings/${generateSessionSid(sessionId)}`);
const res = await request.get(`/api/v2/recyclebin/settings/${generateSessionSid(sessionId)}`);
return res?.data;
}

export async function updateRecycleConfig(
config: Partial<IRecycleConfig>,
sessionId: string,
): Promise<boolean> {
const res = await request.patch(`/api/v1/recyclebin/settings`, {
const res = await request.patch(`/api/v2/recyclebin/settings`, {
data: {
sessionIds: [sessionId],
settings: config,
Expand All @@ -46,7 +46,7 @@ export async function updateRecycleConfig(

export async function getPurgeAllSQL(sessionId: string, dbName: string) {
const result = await request.patch(
`/api/v1/recyclebin/purgeAll/${generateDatabaseSid(dbName, sessionId)}`,
`/api/v2/recyclebin/purgeAll/${generateDatabaseSid(dbName, sessionId)}`,
);
return !!result?.data;
}
Expand All @@ -57,7 +57,7 @@ export async function getDeleteSQL(
dbName: string,
) {
const sid = generateDatabaseSid(dbName, sessionId);
const result = await request.patch(`/api/v1/recyclebin/purge/${sid}`, {
const result = await request.patch(`/api/v2/recyclebin/purge/${sid}`, {
data: recycleObjects,
});
return !!result?.data;
Expand All @@ -69,7 +69,7 @@ export async function getUpdateSQL(
dbName: string,
) {
const sid = generateDatabaseSid(dbName, sessionId);
const result = await request.patch(`/api/v1/recyclebin/flashback/${sid}`, {
const result = await request.patch(`/api/v2/recyclebin/flashback/${sid}`, {
data: recycleObjects,
});
return !!result?.data;
Expand Down
2 changes: 1 addition & 1 deletion src/store/sessionManager/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ class SessionStore {
@action
public async getRecycleObjectList() {
// ListRecycleObjects
const res = await request.get(`/api/v1/recyclebin/list/${generateSessionSid(this.sessionId)}`);
const res = await request.get(`/api/v2/recyclebin/list/${generateSessionSid(this.sessionId)}`);
const recycleObjects = res?.data || [];
this.recycleObjects = recycleObjects.map((r: IRecycleObject, i: number) => ({
...r,
Expand Down

0 comments on commit 34a52a1

Please sign in to comment.