Skip to content

Commit

Permalink
Non-Admins can replace users on cht-core >4.4 (#77)
Browse files Browse the repository at this point in the history
1.1.7
  • Loading branch information
kennsippell committed Mar 20, 2024
1 parent b110678 commit 9ad5dbf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cht-user-management",
"version": "1.1.6",
"version": "1.1.7",
"main": "dist/index.js",
"dependencies": {
"@fastify/autoload": "^5.8.0",
Expand Down
8 changes: 7 additions & 1 deletion src/lib/cht-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,16 @@ export class ChtApi {
};

private async getUsersAtPlace(placeId: string): Promise<string[]> {
const url = `${this.protocolAndHost}/_users/_find`;
// #76 mm-online users cant query _users db after core4.4
const url = `${this.protocolAndHost}/medic/_find`;
const payload = {
selector: {
type: 'user-settings',
facility_id: placeId,
$or: [
{ inactive: false },
{ inactive: { $exists: false } }
]
},
};

Expand Down

0 comments on commit 9ad5dbf

Please sign in to comment.