-
Notifications
You must be signed in to change notification settings - Fork 4
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 #128 from AI4Bharat/btns
guest_workspace
- Loading branch information
Showing
19 changed files
with
1,352 additions
and
205 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,47 @@ | ||
/** | ||
* Login API | ||
*/ | ||
import API from "../../api"; | ||
import ENDPOINTS from "../../../../config/apiendpoint" | ||
import constants from "../../constants"; | ||
|
||
export default class EditGuestWorkspace extends API { | ||
constructor(workspaceId,workspacePassword ,timeout = 2000) { | ||
super("PATCH", timeout, false); | ||
this.workspace_password = workspacePassword | ||
this.type = constants.ARCHIVE_WORKSPACE; | ||
this.endpoint = `${super.apiEndPointAuto()}${ENDPOINTS.getWorkspaces}${workspaceId}/edit_workspace/`; | ||
} | ||
|
||
processResponse(res) { | ||
super.processResponse(res); | ||
if (res) { | ||
this.editworkspace= res; | ||
} | ||
} | ||
|
||
apiEndPoint() { | ||
return this.endpoint; | ||
} | ||
|
||
getBody() { | ||
return { | ||
workspace_password:this.workspace_password, | ||
} | ||
} | ||
|
||
|
||
getHeaders() { | ||
this.headers = { | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Authorization": `JWT ${localStorage.getItem('anudesh_access_token')}` | ||
}, | ||
}; | ||
return this.headers; | ||
} | ||
|
||
getPayload() { | ||
return this.archiveworkspace; | ||
} | ||
} |
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,46 @@ | ||
/** | ||
* Login API | ||
*/ | ||
import API from "../../api"; | ||
import ENDPOINTS from "../../../../config/apiendpoint" | ||
import constants from "../../constants"; | ||
|
||
export default class EditWorkspace extends API { | ||
constructor(workspaceId, timeout = 2000) { | ||
super("PATCH", timeout, false); | ||
this.type = constants.ARCHIVE_WORKSPACE; | ||
this.endpoint = `${super.apiEndPointAuto()}${ENDPOINTS.getWorkspaces}${workspaceId}/edit_workspace/`; | ||
} | ||
|
||
processResponse(res) { | ||
super.processResponse(res); | ||
if (res) { | ||
this.editworkspace= res; | ||
} | ||
} | ||
|
||
apiEndPoint() { | ||
return this.endpoint; | ||
} | ||
|
||
getBody() { | ||
return { | ||
guest_workspace: false | ||
} | ||
} | ||
|
||
|
||
getHeaders() { | ||
this.headers = { | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Authorization": `JWT ${localStorage.getItem('anudesh_access_token')}` | ||
}, | ||
}; | ||
return this.headers; | ||
} | ||
|
||
getPayload() { | ||
return this.archiveworkspace; | ||
} | ||
} |
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,48 @@ | ||
/** | ||
* Login API | ||
*/ | ||
import API from "../../api"; | ||
import ENDPOINTS from "../../../../config/apiendpoint" | ||
import constants from "../../constants"; | ||
|
||
export default class CreateGuestWorkspace extends API { | ||
constructor(workspaceId,workspacePassword ,timeout = 2000) { | ||
super("PATCH", timeout, false); | ||
this.workspace_password = workspacePassword | ||
this.type = constants.ARCHIVE_WORKSPACE; | ||
this.endpoint = `${super.apiEndPointAuto()}${ENDPOINTS.getWorkspaces}${workspaceId}/edit_workspace/`; | ||
} | ||
|
||
processResponse(res) { | ||
super.processResponse(res); | ||
if (res) { | ||
this.editworkspace= res; | ||
} | ||
} | ||
|
||
apiEndPoint() { | ||
return this.endpoint; | ||
} | ||
|
||
getBody() { | ||
return { | ||
workspace_password:this.workspace_password, | ||
guest_workspace: true | ||
} | ||
} | ||
|
||
|
||
getHeaders() { | ||
this.headers = { | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Authorization": `JWT ${localStorage.getItem('anudesh_access_token')}` | ||
}, | ||
}; | ||
return this.headers; | ||
} | ||
|
||
getPayload() { | ||
return this.archiveworkspace; | ||
} | ||
} |
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
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.