Skip to content

Commit

Permalink
revert getProjectByTheme
Browse files Browse the repository at this point in the history
  • Loading branch information
oumeimaelisbihani committed Feb 4, 2025
1 parent 5feab87 commit 2fe825e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions apps/nuxt/src/tools/project/projectFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ export default class ProjectFilter {
if (!projects.value) {
return undefined
}

const results = this.getProjectsByTheme(projects.value, theme.value ?? undefined)
let results = projects.value
if (theme.value) {
results = this.getProjectsByTheme(projects.value, theme.value)
}
return results.filter((project: ProjectType) => {
return this.byCompanyData(project, useFiltersStore().filters[FilterItemKeys.companyData])
})
Expand All @@ -30,7 +32,9 @@ export default class ProjectFilter {

static getProjectsByTheme(projects: ProjectType[], themeType?: ThemeId): ProjectType[] {
return projects.filter((project: ProjectType) => {
return themeType ? this.byTheme(project, themeType) : project.themes
return themeType
? this.byTheme(project, themeType)
: project.themes.some((themeId) => Theme.getTags().some(({ id }) => id === themeId))
})
}

Expand Down
1 change: 0 additions & 1 deletion apps/nuxt/src/tools/project/projectManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export class ProjectManager {
const resultApi = await this._getProjectsFromApi(filteredData)
if (resultApi.isOk()) {
this._useProject.projects = resultApi.data
console.log('PROJECTS', resultApi.data)
this._useProject.hasProjects = true
this._useProject.hasError = false
} else {
Expand Down

0 comments on commit 2fe825e

Please sign in to comment.