musora-content-services 1.0.222 → 1.0.223

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
+ ### [1.0.223](https://github.com/railroadmedia/musora-content-services/compare/v1.0.222...v1.0.223) (2024-12-06)
6
+
5
7
  ### [1.0.222](https://github.com/railroadmedia/musora-content-services/compare/v1.0.221...v1.0.222) (2024-12-06)
6
8
 
7
9
  ### [1.0.221](https://github.com/railroadmedia/musora-content-services/compare/v1.0.220...v1.0.221) (2024-12-06)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "1.0.222",
3
+ "version": "1.0.223",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -461,7 +461,7 @@ function filtersToGroq(filters, selectedFilters = []) {
461
461
  return `gear match "${value}"`;
462
462
  } else if (key === 'instrumentless' && !selectedFilters.includes(key)) {
463
463
  if (value === "Full Song Only") {
464
- return `(!instrumentless || instrumentless != null)`;
464
+ return `(!instrumentless || instrumentless == null)`;
465
465
  } else if (value === "Instrument Removed") {
466
466
  return `instrumentless`;
467
467
  } else {
@@ -828,11 +828,12 @@ export async function fetchAllFilterOptions(
828
828
 
829
829
  const includedFieldsFilter = filters?.length ? filtersToGroq(filters) : undefined;
830
830
  const progressFilter = progressIds ? `&& railcontent_id in [${progressIds.join(',')}]` : "";
831
+ const isAdmin = (await fetchUserPermissions()).isAdmin;
831
832
 
832
833
  const constructCommonFilter = (excludeFilter) => {
833
834
  const filterWithoutOption = excludeFilter ? filtersToGroq(filters, excludeFilter) : includedFieldsFilter;
834
835
  const statusFilter = ' && status == "published"';
835
- const includeStatusFilter = !['instructor','artist','genre'].includes(contentType);
836
+ const includeStatusFilter = !isAdmin && !['instructor','artist','genre'].includes(contentType);
836
837
 
837
838
  return coachId
838
839
  ? `brand == '${brand}' && status == "published" && references(*[_type=='instructor' && railcontent_id == ${coachId}]._id) ${filterWithoutOption || ''}`