chore(medusa): rm default created at field (#8213)
**What** To maintain the backward compatibility, we use to populate `created_at` no matter what. But since we can break things from v1, I ll remove it as we moved the default ordering to the repository layer
This commit is contained in:
1 parent
f74fdcb644
commit
c307972a99
4 files changed
+7
-15
No files matched your search
@@ -195,7 +195,7 @@ describe("validateAndTransformQuery", () => {
|
||||
|
||||
expect(mockRequest.listConfig).toEqual(
|
||||
expect.objectContaining({
|
||||
select: ["id", "created_at"],
|
||||
select: ["id"],
|
||||
})
|
||||
)
|
||||
|
||||
@@ -406,13 +406,13 @@ describe("validateAndTransformQuery", () => {
|
||||
|
||||
expect(mockRequest.listConfig).toEqual(
|
||||
expect.objectContaining({
|
||||
select: ["store.name", "created_at", "id"],
|
||||
select: ["store.name", "id"],
|
||||
relations: ["store"],
|
||||
})
|
||||
)
|
||||
expect(mockRequest.remoteQueryConfig).toEqual(
|
||||
expect.objectContaining({
|
||||
fields: ["store.name", "created_at", "id"],
|
||||
fields: ["store.name", "id"],
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import {
|
||||
getSetDifference,
|
||||
isDefined,
|
||||
isPresent,
|
||||
MedusaError,
|
||||
stringToSelectRelationObject,
|
||||
} from "@medusajs/utils"
|
||||
import { pick } from "lodash"
|
||||
import { MedusaError, isDefined } from "@medusajs/utils"
|
||||
import { RequestQueryFields } from "@medusajs/types"
|
||||
import { FindConfig, QueryConfig } from "../types/common"
|
||||
|
||||
@@ -76,10 +77,6 @@ export function prepareListQuery<T extends RequestQueryFields, TEntity>(
|
||||
})
|
||||
}
|
||||
|
||||
// TODO: Maintain backward compatibility, remove in future. the created at was only added in the list query for default order
|
||||
if (queryConfig.isList) {
|
||||
allFields.add("created_at")
|
||||
}
|
||||
allFields.add("id")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user