Skip to content

Commit

Permalink
[TRELLO-2516] Add image & path to categories API
Browse files Browse the repository at this point in the history
  • Loading branch information
charlescd committed Aug 23, 2024
1 parent bdb0ecb commit f2b2ff2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions mobile-tools/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ export const Config = {
oneSignalEnablePush: process.env.ONE_SIGNAL_ENABLE_PUSH === 'true' ?? false,
oneSignalAppId: process.env.ONE_SIGNAL_APP_ID ?? '',
oneSignaleApiKey: process.env.ONE_SIGNAL_API_KEY ?? '',
websiteUrl: process.env.WEBSITE_URL ?? '',
}
5 changes: 5 additions & 0 deletions mobile-tools/src/services/categories.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import fs from 'fs'
import {Config} from '../config/config.js'

export interface Category {
category: string
description: string
id: string
path: string
img: string
}

const anomaliesFr = JSON.parse(fs.readFileSync('../shared/anomalies/json/anomalies_fr.json', 'utf-8'))
Expand All @@ -17,6 +20,8 @@ const categoriesFr: Category[] = anomaliesFr.map((anomaly: any) => {
category: anomaly.category,
description: anomaly.description,
id: anomaly.id,
path: anomaly.path,
img: `${Config.websiteUrl}/image/pictos/${anomaly.img}.png`,
}
})

Expand Down

0 comments on commit f2b2ff2

Please sign in to comment.