Skip to content

Commit

Permalink
Remove sorting entries by updatedAt (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
imsitnikov authored Oct 1, 2024
1 parent 2dc8a79 commit f60d53e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 16 deletions.
4 changes: 0 additions & 4 deletions src/db/models/favorite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ class Favorite extends Model {
.modify((builder) => {
if (orderBy) {
switch (orderBy.field) {
case 'updatedAt':
builder.orderBy('entries.updatedAt', orderBy.direction);
builder.orderBy('entries.entryId');
break;
case 'createdAt':
builder.orderBy('entries.createdAt', orderBy.direction);
builder.orderBy('entries.entryId');
Expand Down
2 changes: 1 addition & 1 deletion src/db/models/favorite/scheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const validateGetFavorites = compileSchema({
properties: {
field: {
type: 'string',
enum: ['updatedAt', 'createdAt', 'name'],
enum: ['createdAt', 'name'],
},
direction: {
type: 'string',
Expand Down
4 changes: 0 additions & 4 deletions src/db/models/navigation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ class Navigation extends Model {
.modify((builder) => {
if (orderBy) {
switch (orderBy.field) {
case 'updatedAt':
builder.orderBy('revisions.updatedAt', orderBy.direction);
builder.orderBy('entries.entryId');
break;
case 'createdAt':
builder.orderBy('entries.createdAt', orderBy.direction);
builder.orderBy('entries.entryId');
Expand Down
2 changes: 1 addition & 1 deletion src/db/models/navigation/scheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const validateGetEntries = compileSchema({
properties: {
field: {
type: 'string',
enum: ['updatedAt', 'createdAt', 'name'],
enum: ['createdAt', 'name'],
},
direction: {
type: 'string',
Expand Down
8 changes: 2 additions & 6 deletions src/services/new/workbook/get-workbook-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const validateArgs = makeSchemaValidator({
properties: {
field: {
type: 'string',
enum: ['name', 'updatedAt', 'createdAt'],
enum: ['name', 'createdAt'],
},
direction: {
type: 'string',
Expand All @@ -71,7 +71,7 @@ export interface GetWorkbookContentArgs {
name?: string;
};
orderBy?: {
field: 'name' | 'updatedAt' | 'createdAt';
field: 'name' | 'createdAt';
direction: 'asc' | 'desc';
};
scope?: EntryScope | EntryScope[];
Expand Down Expand Up @@ -151,10 +151,6 @@ export const getWorkbookContent = async (
modify: (builder) => {
if (orderBy) {
switch (orderBy.field) {
case 'updatedAt':
builder.orderBy('revisions.updatedAt', orderBy.direction);
builder.orderBy('entries.entryId');
break;
case 'createdAt':
builder.orderBy('entries.createdAt', orderBy.direction);
builder.orderBy('entries.entryId');
Expand Down

0 comments on commit f60d53e

Please sign in to comment.