Skip to content

Commit

Permalink
resource category (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
abeglova authored Jul 2, 2024
1 parent e9068e1 commit 17e06e4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"homepage": "https://github.com/mitodl/course-search-utils#readme",
"dependencies": {
"@mitodl/open-api-axios": "^2024.6.4",
"@mitodl/open-api-axios": "^2024.7.2",
"axios": "^1.6.7",
"fuse.js": "^7.0.0",
"query-string": "^6.13.1",
Expand Down
1 change: 1 addition & 0 deletions src/facet_display/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export interface Facets {
content_feature_type?: string[]
learning_format?: string[]
certification_type?: string[]
resource_category?: string[]
}

export interface BooleanFacets {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useInfiniteSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type ResourceSearchRequest =
v1.LearningResourcesSearchApiLearningResourcesSearchRetrieveRequest
type ContentFileSearchRequest =
v1.ContentFileSearchApiContentFileSearchRetrieveRequest
type SearchResponse = v1.LearningResourceSearchResponse
type SearchResponse = v1.LearningResourcesSearchResponse

type Status = "pending" | "error" | "success"

Expand Down
4 changes: 3 additions & 1 deletion src/hooks/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const {
LearningResourcesSearchRetrieveSortbyEnum: SortByEnum,
LearningResourcesSearchRetrieveAggregationsEnum: AggregationsEnum,
LearningResourcesSearchRetrieveLearningFormatEnum: LearningFormatEnum,
LearningResourcesSearchRetrieveResourceCategoryEnum: ResourceCategoryEnum,
CertificationTypeEnum,
ContentFileSearchRetrieveSortbyEnum,
ContentFileSearchRetrieveAggregationsEnum
Expand Down Expand Up @@ -57,7 +58,8 @@ const resourceSearchValidators: QueryParamValidators<ResourceSearchRequest> = {
id: numbers,
free: firstBoolean,
learning_format: withinEnum(Object.values(LearningFormatEnum)),
certification_type: withinEnum(Object.values(CertificationTypeEnum))
certification_type: withinEnum(Object.values(CertificationTypeEnum)),
resource_category: withinEnum(Object.values(ResourceCategoryEnum))
}

const contentSearchValidators: QueryParamValidators<ContentFileSearchRequest> =
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -762,10 +762,10 @@
dependencies:
make-plural "^7.0.0"

"@mitodl/open-api-axios@^2024.6.4":
version "2024.6.4"
resolved "https://registry.yarnpkg.com/@mitodl/open-api-axios/-/open-api-axios-2024.6.4.tgz#e906b764b115665858570f4bbf04bc065a2eeb4f"
integrity sha512-oJ3AwyDTrHOQXairhtqHyBHb9CzIf7En2gV7y6BANDKXhYGXKOVvxqWtvV+1jsCzgGWT6A2nBXYsKuVIGoAP6w==
"@mitodl/open-api-axios@^2024.7.2":
version "2024.7.2"
resolved "https://registry.yarnpkg.com/@mitodl/open-api-axios/-/open-api-axios-2024.7.2.tgz#7d33927e55b0ac8be7971e9f96455329e2778b20"
integrity sha512-x4NyMEjxjNZ3ppqq9gNO4oI83ZuoAJaCdwVQw2kBWC6RZgV7vcPdqlXIkKg1JtaY9ubqQxlQ82BtmlrFhTuIyQ==
dependencies:
"@types/node" "^20.11.19"
axios "^1.6.5"
Expand Down

0 comments on commit 17e06e4

Please sign in to comment.