fix(scenarios): order runs by createdAt desc, scenarios list by updatedAt desc
This commit is contained in:
@@ -155,7 +155,7 @@ export const sessions = {
|
|||||||
|
|
||||||
export const scenarios = {
|
export const scenarios = {
|
||||||
list(page = 1, limit = 50): Promise<PaginatedResponse<Scenario>> {
|
list(page = 1, limit = 50): Promise<PaginatedResponse<Scenario>> {
|
||||||
return request(`/scenarios?page=${page}&limit=${limit}`);
|
return request(`/scenarios?page=${page}&limit=${limit}&orderBy=updatedAt&orderDir=DESC`);
|
||||||
},
|
},
|
||||||
get(id: string): Promise<Scenario & { steps: ScenarioStep[] }> {
|
get(id: string): Promise<Scenario & { steps: ScenarioStep[] }> {
|
||||||
return request(`/scenarios/${id}`);
|
return request(`/scenarios/${id}`);
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ export class ScenarioService {
|
|||||||
const [data, total] = await this.runRepo.findAndCount({
|
const [data, total] = await this.runRepo.findAndCount({
|
||||||
where,
|
where,
|
||||||
relations: ["stepRuns"],
|
relations: ["stepRuns"],
|
||||||
order: { id: "DESC", stepRuns: { order: "ASC" } },
|
order: { createdAt: "DESC" },
|
||||||
skip: (page - 1) * limit,
|
skip: (page - 1) * limit,
|
||||||
take: limit,
|
take: limit,
|
||||||
});
|
});
|
||||||
@@ -235,7 +235,7 @@ export class ScenarioService {
|
|||||||
const [data, total] = await this.runRepo.findAndCount({
|
const [data, total] = await this.runRepo.findAndCount({
|
||||||
where,
|
where,
|
||||||
relations: ["stepRuns", "scenario"],
|
relations: ["stepRuns", "scenario"],
|
||||||
order: { id: "DESC", stepRuns: { order: "ASC" } },
|
order: { createdAt: "DESC" },
|
||||||
skip: (page - 1) * limit,
|
skip: (page - 1) * limit,
|
||||||
take: limit,
|
take: limit,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user