Skip to content

Commit

Permalink
fix: remove subtype from member mappin
Browse files Browse the repository at this point in the history
  • Loading branch information
thisislawatts committed Jan 2, 2022
1 parent 466eadb commit e8612ca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/stores/Maps/maps.store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,23 @@ describe('maps.store', () => {
moderation: 'awaiting-moderation',
}));
});

it('do not set subType if passed with member profile', async () => {
await store.setUserPin({
profileType: 'member',
workspaceType: 'shredder',
location: {
latlng: {
lat: 0,
lng: 0,
}
}
});

// Assert
expect(store.db.set).toHaveBeenCalledWith(expect.not.objectContaining({
subType: 'shredder',
}));
});
})
});
2 changes: 1 addition & 1 deletion src/stores/Maps/maps.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export class MapsStore extends ModuleStore {
type,
moderation,
}
if (user.workspaceType) {
if (type !== 'member' && user.workspaceType) {
pin.subType = user.workspaceType
}
logger.debug('setting user pin', pin)
Expand Down

0 comments on commit e8612ca

Please sign in to comment.