musora-content-services 2.95.4 → 2.95.5
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
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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
|
+
### [2.95.5](https://github.com/railroadmedia/musora-content-services/compare/v2.95.4...v2.95.5) (2025-12-08)
|
|
6
|
+
|
|
5
7
|
### [2.95.4](https://github.com/railroadmedia/musora-content-services/compare/v2.95.3...v2.95.4) (2025-12-08)
|
|
6
8
|
|
|
7
9
|
|
package/package.json
CHANGED
package/src/lib/sanity/query.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Monoid } from '../ads/monoid'
|
|
2
|
-
import { Semigroup } from '../ads/semigroup'
|
|
3
2
|
|
|
4
3
|
export interface BuildQueryOptions {
|
|
5
4
|
sort?: string
|
|
@@ -50,8 +49,9 @@ const slice: Monoid<string> = {
|
|
|
50
49
|
concat: (a, b) => b || a,
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
const project:
|
|
54
|
-
|
|
52
|
+
const project: Monoid<string> = {
|
|
53
|
+
empty: '',
|
|
54
|
+
concat: (a, b) => (!a ? b : !b ? a : `${a}, ${b}`),
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
export const query = (): QueryBuilder => {
|
|
@@ -59,7 +59,7 @@ export const query = (): QueryBuilder => {
|
|
|
59
59
|
filter: and.empty,
|
|
60
60
|
ordering: order.empty,
|
|
61
61
|
slice: slice.empty,
|
|
62
|
-
projection:
|
|
62
|
+
projection: project.empty,
|
|
63
63
|
postFilter: and.empty,
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -113,7 +113,7 @@ export const query = (): QueryBuilder => {
|
|
|
113
113
|
*[${filter}]
|
|
114
114
|
${ordering}
|
|
115
115
|
${slice}
|
|
116
|
-
{ ${projection} }
|
|
116
|
+
${projection.length > 0 ? `{ ${projection} }` : ''}
|
|
117
117
|
${state.postFilter ? `[${state.postFilter}]` : ''}
|
|
118
118
|
`.trim()
|
|
119
119
|
},
|
|
@@ -55,7 +55,7 @@ export async function fetchArtists(
|
|
|
55
55
|
|
|
56
56
|
const q = `{
|
|
57
57
|
"data": ${data},
|
|
58
|
-
"total": ${total}
|
|
58
|
+
"total": count(${total})
|
|
59
59
|
}`
|
|
60
60
|
|
|
61
61
|
return fetchSanity(q, true, { processNeedAccess: false, processPageType: false })
|
|
@@ -162,7 +162,7 @@ export async function fetchArtistLessons(
|
|
|
162
162
|
|
|
163
163
|
const q = `{
|
|
164
164
|
"data": ${data},
|
|
165
|
-
"total": ${total}
|
|
165
|
+
"total": count(${total})
|
|
166
166
|
}`
|
|
167
167
|
|
|
168
168
|
return fetchSanity(q, true, { processNeedAccess: false, processPageType: false })
|
|
@@ -55,7 +55,7 @@ export async function fetchGenres(
|
|
|
55
55
|
|
|
56
56
|
const q = `{
|
|
57
57
|
"data": ${data},
|
|
58
|
-
"total": ${total}
|
|
58
|
+
"total": count(${total})
|
|
59
59
|
}`
|
|
60
60
|
|
|
61
61
|
return fetchSanity(q, true, { processNeedAccess: false, processPageType: false })
|
|
@@ -151,7 +151,6 @@ export async function fetchGenreLessons(
|
|
|
151
151
|
sort = getSortOrder(sort, brand)
|
|
152
152
|
const data = query()
|
|
153
153
|
.and(filterWithRestrictions)
|
|
154
|
-
.and(`brand == ${brand}`)
|
|
155
154
|
.order(sort)
|
|
156
155
|
.slice(offset, offset + limit)
|
|
157
156
|
.select(...(fieldsString ? [fieldsString] : []))
|
|
@@ -161,7 +160,7 @@ export async function fetchGenreLessons(
|
|
|
161
160
|
|
|
162
161
|
const q = `{
|
|
163
162
|
"data": ${data},
|
|
164
|
-
"total": ${total}
|
|
163
|
+
"total": count(${total})
|
|
165
164
|
}`
|
|
166
165
|
|
|
167
166
|
return fetchSanity(q, true, { processNeedAccess: false, processPageType: false })
|