fix(scenarios): order runs by createdAt desc, scenarios list by updatedAt desc

This commit is contained in:
2026-04-10 13:57:34 +03:00
parent b26eb10b3d
commit 607abcafc5
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -155,7 +155,7 @@ export const sessions = {
export const scenarios = {
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[] }> {
return request(`/scenarios/${id}`);
+2 -2
View File
@@ -218,7 +218,7 @@ export class ScenarioService {
const [data, total] = await this.runRepo.findAndCount({
where,
relations: ["stepRuns"],
order: { id: "DESC", stepRuns: { order: "ASC" } },
order: { createdAt: "DESC" },
skip: (page - 1) * limit,
take: limit,
});
@@ -235,7 +235,7 @@ export class ScenarioService {
const [data, total] = await this.runRepo.findAndCount({
where,
relations: ["stepRuns", "scenario"],
order: { id: "DESC", stepRuns: { order: "ASC" } },
order: { createdAt: "DESC" },
skip: (page - 1) * limit,
take: limit,
});