musora-content-services 1.0.195 → 1.0.197
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.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/services/sanity.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.0.197](https://github.com/railroadmedia/musora-content-services/compare/v1.0.196...v1.0.197) (2024-11-29)
|
|
6
|
+
|
|
7
|
+
### [1.0.196](https://github.com/railroadmedia/musora-content-services/compare/v1.0.195...v1.0.196) (2024-11-29)
|
|
8
|
+
|
|
5
9
|
### [1.0.195](https://github.com/railroadmedia/musora-content-services/compare/v1.0.194...v1.0.195) (2024-11-29)
|
|
6
10
|
|
|
7
11
|
### [1.0.194](https://github.com/railroadmedia/musora-content-services/compare/v1.0.193...v1.0.194) (2024-11-29)
|
package/package.json
CHANGED
package/src/services/sanity.js
CHANGED
|
@@ -752,9 +752,11 @@ export function getSortOrder(sort = '-published_on', groupBy) {
|
|
|
752
752
|
sortOrder = groupBy ? 'name' : "title";
|
|
753
753
|
break;
|
|
754
754
|
case "name":
|
|
755
|
-
case "popularity":
|
|
756
755
|
sortOrder = sort;
|
|
757
756
|
break;
|
|
757
|
+
case "popularity":
|
|
758
|
+
sortOrder = isDesc ? "coalesce(popularity, -1)" : "popularity";
|
|
759
|
+
break;
|
|
758
760
|
case "published_on":
|
|
759
761
|
default:
|
|
760
762
|
sortOrder = "published_on";
|
|
@@ -1956,7 +1958,7 @@ function buildEntityAndTotalQuery(
|
|
|
1956
1958
|
{
|
|
1957
1959
|
${fields}
|
|
1958
1960
|
},
|
|
1959
|
-
"total":
|
|
1961
|
+
"total": 0
|
|
1960
1962
|
}`;
|
|
1961
1963
|
return query;
|
|
1962
1964
|
}
|