-
Notifications
You must be signed in to change notification settings - Fork 13
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 #1046 from AI4Bharat/Contextual-TransliterationCon…
…tactSource-fix Contextual transliteration logging source fix
- Loading branch information
Showing
10 changed files
with
817 additions
and
12 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
47 changes: 47 additions & 0 deletions
47
src/redux/actions/api/Annotation/PostTransliterationForLogging.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,47 @@ | ||
import API from "../../../api"; | ||
import ENDPOINTS from "../../../../config/apiendpoint"; | ||
import constants from "../../../constants"; | ||
|
||
export default class PostTransliterationForLogging extends API { | ||
constructor(source_text, target_text, orginal_romanised_text,edited_romanised_text,target_language, timeout = 2000) { | ||
super("POST", timeout, false); | ||
this.transliterationLog = { | ||
source_english_text: source_text, | ||
indic_translation_text: target_text, | ||
romanised_text: orginal_romanised_text, | ||
edited_romanised_text: edited_romanised_text, | ||
language: target_language, | ||
}; | ||
this.type = constants.POST_TRANSLITERATION_LOG; | ||
this.endpoint = `${super.apiEndPointAuto()}${ENDPOINTS.transliteration_log}`; | ||
} | ||
|
||
processResponse(res) { | ||
super.processResponse(res); | ||
if (res) { | ||
this.newTransliterationLog = res; | ||
} | ||
} | ||
|
||
apiEndPoint() { | ||
return this.endpoint; | ||
} | ||
|
||
getBody() { | ||
return this.transliterationLog; | ||
} | ||
|
||
getHeaders() { | ||
this.headers = { | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Authorization": `JWT ${localStorage.getItem('shoonya_access_token')}` | ||
}, | ||
}; | ||
return this.headers; | ||
} | ||
|
||
getPayload() { | ||
return this.newTransliterationLog; | ||
} | ||
} |
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
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.