daily-code icon indicating copy to clipboard operation
daily-code copied to clipboard

Learning Paths Should be sorted according to Creation Date

Open PranavKumar20 opened this issue 1 year ago • 1 comments

Currently Learning Paths are displayed in random order on the website, But if is displayed in sorted to date it will be better to navigate.

PranavKumar20 avatar Feb 11 '24 07:02 PranavKumar20

const tracks = await db.track.findMany({
      where: {
        hidden: false,
      },
      include: {
        problems: {
          select: {
            problem: true,
          },
          orderBy: [
            {
              sortingOrder: "desc",
            },
          ],
        },
        category: {
          select: {
            category: true,
          },
        },
      },
      orderBy: {
        createdAt: "asc",
      },
    });

It seems that the query is perfectly fine.

SujithThirumalaisamy avatar Apr 10 '24 07:04 SujithThirumalaisamy