Merge pull request #493 from appwrite/feat-default-sort

Replace sorting by $createdAt with natural order
This commit is contained in:
Christy Jacob
2023-08-09 12:12:46 +04:00
committed by GitHub
16 changed files with 23 additions and 16 deletions
@@ -15,7 +15,7 @@ export const load: PageLoad = async ({ url, route }) => {
organizations: await sdk.forConsole.teams.list([
Query.offset(offset),
Query.limit(limit),
Query.orderDesc('$createdAt')
Query.orderDesc('')
])
};
};
@@ -15,7 +15,8 @@ export const load: PageLoad = async ({ params, url, route }) => {
projects: await sdk.forConsole.projects.list([
Query.offset(offset),
Query.equal('teamId', params.organization),
Query.limit(CARD_LIMIT)
Query.limit(CARD_LIMIT),
Query.orderDesc('')
])
};
};
@@ -16,7 +16,7 @@ export const load: PageLoad = async ({ url, route }) => {
search,
page,
users: await sdk.forProject.users.list(
[Query.limit(limit), Query.offset(offset), Query.orderDesc('$createdAt')],
[Query.limit(limit), Query.offset(offset), Query.orderDesc('')],
search
)
};
@@ -16,7 +16,7 @@ export const load: PageLoad = async ({ url, route }) => {
search,
page,
teams: await sdk.forProject.teams.list(
[Query.limit(limit), Query.offset(offset), Query.orderDesc('$createdAt')],
[Query.limit(limit), Query.offset(offset), Query.orderDesc('')],
search
)
};
@@ -18,7 +18,7 @@ export const load: PageLoad = async ({ params, depends, url, route }) => {
limit,
memberships: await sdk.forProject.teams.listMemberships(
teamId,
[Query.limit(limit), Query.offset(offset), Query.orderDesc('$createdAt')],
[Query.limit(limit), Query.offset(offset), Query.orderDesc('')],
search
)
};
@@ -17,7 +17,7 @@ export const load: PageLoad = async ({ url, route }) => {
databases: await sdk.forProject.databases.list([
Query.limit(limit),
Query.offset(offset),
Query.orderDesc('$createdAt')
Query.orderDesc('')
])
};
};
@@ -17,7 +17,7 @@ export const load: PageLoad = async ({ params, url, route }) => {
collections: await sdk.forProject.databases.listCollections(params.database, [
Query.limit(limit),
Query.offset(offset),
Query.orderDesc('$createdAt')
Query.orderDesc('')
])
};
};
@@ -19,7 +19,7 @@ export const load: LayoutLoad = async ({ params, depends }) => {
),
subNavigation: SubNavigation,
allCollections: await sdk.forProject.databases.listCollections(params.database, [
Query.orderDesc('$createdAt')
Query.orderDesc('')
])
};
} catch (e) {
@@ -18,7 +18,7 @@ export const load: PageLoad = async ({ params, depends, url, route }) => {
documents: await sdk.forProject.databases.listDocuments(
params.database,
params.collection,
[Query.limit(limit), Query.offset(offset), Query.orderDesc('$createdAt')]
[Query.limit(limit), Query.offset(offset), Query.orderDesc('')]
)
};
};
@@ -74,7 +74,7 @@
if (search) {
const collections = await sdk.forProject.databases.listCollections(
databaseId,
[Query.orderDesc('$createdAt')],
[Query.orderDesc('')],
search
);
return collections;
@@ -61,7 +61,7 @@
const documents = await sdk.forProject.databases.listDocuments(
databaseId,
attribute.relatedCollection,
[Query.startsWith('$id', search), Query.orderDesc('$createdAt')]
[Query.startsWith('$id', search), Query.orderDesc('')]
);
return documents;
} else {
@@ -13,6 +13,10 @@ export const load: PageLoad = async ({ url, depends, route }) => {
return {
offset,
limit,
functions: await sdk.forProject.functions.list([Query.limit(limit), Query.offset(offset)])
functions: await sdk.forProject.functions.list([
Query.limit(limit),
Query.offset(offset),
Query.orderDesc('')
])
};
};
@@ -15,7 +15,8 @@ export const load: PageLoad = async ({ params, depends, url, route }) => {
limit,
deployments: await sdk.forProject.functions.listDeployments(params.function, [
Query.limit(limit),
Query.offset(offset)
Query.offset(offset),
Query.orderDesc('')
])
};
};
@@ -15,7 +15,8 @@ export const load: PageLoad = async ({ params, depends, url, route }) => {
limit,
executions: await sdk.forProject.functions.listExecutions(params.function, [
Query.limit(limit),
Query.offset(offset)
Query.offset(offset),
Query.orderDesc('')
])
};
};
@@ -15,7 +15,7 @@ export const load: PageLoad = async ({ url, route }) => {
buckets: await sdk.forProject.storage.listBuckets([
Query.limit(limit),
Query.offset(offset),
Query.orderDesc('$createdAt')
Query.orderDesc('')
])
};
};
@@ -17,7 +17,7 @@ export const load: PageLoad = async ({ params, depends, url, route }) => {
search,
files: await sdk.forProject.storage.listFiles(
params.bucket,
[Query.limit(limit), Query.offset(offset), Query.orderDesc('$createdAt')],
[Query.limit(limit), Query.offset(offset), Query.orderDesc('')],
search
)
};