-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1023 from AI4Bharat/develop
Shoonya Patch Update
- Loading branch information
Showing
12 changed files
with
527 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/redux/actions/api/Organization/ApproveManagerSuggestions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* ApproveManagerSuggestions API | ||
*/ | ||
import API from "../../../api"; | ||
import ENDPOINTS from "../../../../config/apiendpoint"; | ||
import constants from "../../../constants"; | ||
|
||
export default class ApproveManagerSuggestionsAPI extends API { | ||
constructor(userId, timeout = 2000) { | ||
super("POST", timeout, false); | ||
this.type = constants.APPROVE_MANAGER_SUGGESTIONS; | ||
this.userId = userId; | ||
this.endpoint = `${super.apiEndPointAuto()}${ENDPOINTS.getPendingUsers}approve_user/?userId=${this.userId}`; | ||
} | ||
|
||
processResponse(res) { | ||
super.processResponse(res); | ||
if (res) { | ||
this.approveManagerSuggestions = res; | ||
} | ||
} | ||
|
||
apiEndPoint() { | ||
return this.endpoint; | ||
} | ||
|
||
getBody() {} | ||
|
||
getHeaders() { | ||
this.headers = { | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Authorization":`JWT ${localStorage.getItem('shoonya_access_token')}` | ||
}, | ||
}; | ||
return this.headers; | ||
} | ||
|
||
getPayload() { | ||
return this.approveManagerSuggestions; | ||
} | ||
} | ||
|
43 changes: 43 additions & 0 deletions
43
src/redux/actions/api/Organization/GetManagerSuggestions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* GetManagerSuggestion API | ||
*/ | ||
import API from "../../../api"; | ||
import ENDPOINTS from "../../../../config/apiendpoint"; | ||
import constants from "../../../constants"; | ||
|
||
export default class GetManagerSuggestionsAPI extends API { | ||
constructor(orgId, timeout = 2000) { | ||
super("GET", timeout, false); | ||
this.type = constants.GET_MANAGER_SUGGESTIONS; | ||
this.orgId = orgId; | ||
this.endpoint = `${super.apiEndPointAuto()}${ENDPOINTS.getPendingUsers}pending_users/?organisation_id=${this.orgId}`; | ||
} | ||
|
||
processResponse(res) { | ||
super.processResponse(res); | ||
if (res) { | ||
this.managerSuggestions = res; | ||
} | ||
} | ||
|
||
apiEndPoint() { | ||
return this.endpoint; | ||
} | ||
|
||
getBody() {} | ||
|
||
getHeaders() { | ||
this.headers = { | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Authorization":`JWT ${localStorage.getItem('shoonya_access_token')}` | ||
}, | ||
}; | ||
return this.headers; | ||
} | ||
|
||
getPayload() { | ||
return this.managerSuggestions; | ||
} | ||
} | ||
|
51 changes: 51 additions & 0 deletions
51
src/redux/actions/api/Organization/InviteManagerSuggestions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* RequestUsersToOrg API | ||
*/ | ||
import API from "../../../api"; | ||
import ENDPOINTS from "../../../../config/apiendpoint"; | ||
import constants from "../../../constants"; | ||
|
||
export default class InviteManagerSuggestions extends API { | ||
constructor(orgId, emails, role, timeout = 2000) { | ||
super("POST", timeout, false); | ||
this.type = constants.REQUEST_MANAGER_SUGGESTIONS; | ||
this.organization_id = orgId; | ||
this.emails = emails; | ||
this.role = role; | ||
this.endpoint = `${super.apiEndPointAuto()}${ENDPOINTS.getPendingUsers}request_user/`; | ||
} | ||
|
||
processResponse(res) { | ||
super.processResponse(res); | ||
if (res) { | ||
this.InviteManagerSuggestions = res; | ||
} | ||
} | ||
|
||
apiEndPoint() { | ||
return this.endpoint; | ||
} | ||
|
||
getBody() { | ||
return { | ||
organization_id: this.organization_id, | ||
emails : this.emails, | ||
role : this.role | ||
} | ||
} | ||
|
||
getHeaders() { | ||
this.headers = { | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Authorization":`JWT ${localStorage.getItem('shoonya_access_token')}` | ||
}, | ||
}; | ||
return this.headers; | ||
} | ||
|
||
getPayload() { | ||
return this.InviteManagerSuggestions; | ||
} | ||
} | ||
|
43 changes: 43 additions & 0 deletions
43
src/redux/actions/api/Organization/RejectManagerSuggestions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* RejectManagerSuggestions API | ||
*/ | ||
import API from "../../../api"; | ||
import ENDPOINTS from "../../../../config/apiendpoint"; | ||
import constants from "../../../constants"; | ||
|
||
export default class RejectManagerSuggestionsAPI extends API { | ||
constructor(userId, timeout = 2000) { | ||
super("DELETE", timeout, false); | ||
this.type = constants.DELETE_MANAGER_SUGGESTIONS; | ||
this.userId = userId; | ||
this.endpoint = `${super.apiEndPointAuto()}${ENDPOINTS.getPendingUsers}reject_user/?userId=${this.userId}`; | ||
} | ||
|
||
processResponse(res) { | ||
super.processResponse(res); | ||
if (res) { | ||
this.rejecManagerSuggestion = res; | ||
} | ||
} | ||
|
||
apiEndPoint() { | ||
return this.endpoint; | ||
} | ||
|
||
getBody() {} | ||
|
||
getHeaders() { | ||
this.headers = { | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Authorization":`JWT ${localStorage.getItem('shoonya_access_token')}` | ||
}, | ||
}; | ||
return this.headers; | ||
} | ||
|
||
getPayload() { | ||
return this.rejecManagerSuggestion; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import constants from "../../constants"; | ||
|
||
let initialState = { | ||
data: [] | ||
} | ||
const reducer = (state = initialState, action) => { | ||
switch (action.type) { | ||
case constants.GET_MANAGER_SUGGESTIONS: | ||
return { | ||
...state, | ||
data: action.payload | ||
} | ||
|
||
default: | ||
return { | ||
...state | ||
} | ||
} | ||
}; | ||
|
||
export default reducer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.