@gem-sdk/core 1.9.42 → 1.9.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -78,8 +78,8 @@ const loopFetchCollection = async (fetcher, arg)=>{
78
78
  firstVariant: 1,
79
79
  firstMedia: 30,
80
80
  orderBy: {
81
- field: 'TITLE',
82
- direction: 'ASC'
81
+ field: 'PLATFORM_CREATED_AT',
82
+ direction: 'DESC'
83
83
  },
84
84
  orderByMedia: {
85
85
  field: 'POSITION',
@@ -43,11 +43,13 @@ const fetchProduct = async (fetcher, { id , isSample , isStorefront })=>{
43
43
  const variables = {
44
44
  orderBy,
45
45
  where: {
46
- status: 'ACTIVE',
47
46
  isSample,
48
47
  ...isStorefront && {
49
48
  isStorefront
50
49
  },
50
+ ...(!id || id && id.toLowerCase() == 'latest') && {
51
+ status: 'ACTIVE'
52
+ },
51
53
  ...id && id.toLowerCase() !== 'latest' && {
52
54
  baseID: id
53
55
  }
@@ -63,11 +65,13 @@ const fetchVariants = async (fetcher, { id , isSample , isStorefront })=>{
63
65
  const initVariables = {
64
66
  orderBy,
65
67
  where: {
66
- status: 'ACTIVE',
67
68
  isSample,
68
69
  ...isStorefront && {
69
70
  isStorefront
70
71
  },
72
+ ...(!id || id && id.toLowerCase() == 'latest') && {
73
+ status: 'ACTIVE'
74
+ },
71
75
  ...id && id.toLowerCase() !== 'latest' && {
72
76
  baseID: id
73
77
  }
@@ -102,11 +106,13 @@ const fetchMedias = async (fetcher, { id , isSample , isStorefront })=>{
102
106
  const initVariables = {
103
107
  orderBy,
104
108
  where: {
105
- status: 'ACTIVE',
106
109
  isSample,
107
110
  ...isStorefront && {
108
111
  isStorefront
109
112
  },
113
+ ...(!id || id && id.toLowerCase() == 'latest') && {
114
+ status: 'ACTIVE'
115
+ },
110
116
  ...id && id.toLowerCase() !== 'latest' && {
111
117
  baseID: id
112
118
  }
@@ -76,8 +76,8 @@ const loopFetchCollection = async (fetcher, arg)=>{
76
76
  firstVariant: 1,
77
77
  firstMedia: 30,
78
78
  orderBy: {
79
- field: 'TITLE',
80
- direction: 'ASC'
79
+ field: 'PLATFORM_CREATED_AT',
80
+ direction: 'DESC'
81
81
  },
82
82
  orderByMedia: {
83
83
  field: 'POSITION',
@@ -41,11 +41,13 @@ const fetchProduct = async (fetcher, { id , isSample , isStorefront })=>{
41
41
  const variables = {
42
42
  orderBy,
43
43
  where: {
44
- status: 'ACTIVE',
45
44
  isSample,
46
45
  ...isStorefront && {
47
46
  isStorefront
48
47
  },
48
+ ...(!id || id && id.toLowerCase() == 'latest') && {
49
+ status: 'ACTIVE'
50
+ },
49
51
  ...id && id.toLowerCase() !== 'latest' && {
50
52
  baseID: id
51
53
  }
@@ -61,11 +63,13 @@ const fetchVariants = async (fetcher, { id , isSample , isStorefront })=>{
61
63
  const initVariables = {
62
64
  orderBy,
63
65
  where: {
64
- status: 'ACTIVE',
65
66
  isSample,
66
67
  ...isStorefront && {
67
68
  isStorefront
68
69
  },
70
+ ...(!id || id && id.toLowerCase() == 'latest') && {
71
+ status: 'ACTIVE'
72
+ },
69
73
  ...id && id.toLowerCase() !== 'latest' && {
70
74
  baseID: id
71
75
  }
@@ -100,11 +104,13 @@ const fetchMedias = async (fetcher, { id , isSample , isStorefront })=>{
100
104
  const initVariables = {
101
105
  orderBy,
102
106
  where: {
103
- status: 'ACTIVE',
104
107
  isSample,
105
108
  ...isStorefront && {
106
109
  isStorefront
107
110
  },
111
+ ...(!id || id && id.toLowerCase() == 'latest') && {
112
+ status: 'ACTIVE'
113
+ },
108
114
  ...id && id.toLowerCase() !== 'latest' && {
109
115
  baseID: id
110
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.9.42",
3
+ "version": "1.9.47",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",