Skip to content

Commit

Permalink
feat: osem box grouptags for atrai
Browse files Browse the repository at this point in the history
  • Loading branch information
felixerdy committed Jul 16, 2024
1 parent d714139 commit 0dea2b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/lib/api/openSenseMapClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,12 @@ export async function createSenseBoxBike(
longitude: number,
model: senseBoxBikeModel = 'default',
) {
const groupTags = model === 'atrai' ? ['bike', 'ATRAI'] : ['bike']
const boxData = senseBoxBikeModelFactory(
name,
longitude,
latitude,
undefined,
groupTags,
model,
)
const response = await axiosApiInstance.post('/boxes', boxData)
Expand Down
4 changes: 2 additions & 2 deletions src/lib/api/opensensemap-bike-model-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ export const senseBoxBikeModelFactory = (
name: string,
longitude: number,
latitude: number,
grouptag?: string,
grouptags?: string[],
model: senseBoxBikeModel = 'default',
) => {
const baseProperties = {
name: name,
exposure: 'mobile',
location: [longitude, latitude],
grouptag: [grouptag ?? 'bike'],
grouptag: grouptags ?? ['bike'],
}
return {
...baseProperties,
Expand Down

0 comments on commit 0dea2b4

Please sign in to comment.