Changed Application name in Plugin and Added function to run Cron
This commit is contained in:
parent
e8b010a3c5
commit
b7b1c3848f
1 changed files with 15 additions and 2 deletions
|
|
@ -6,7 +6,7 @@ export async function getStats(username: string, credentials: string){
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"x-client": username.concat("-testAPI"),
|
"x-client": "278e719e-5f9c-43b1-9dba-8b73343dc062-HabiticaSync",
|
||||||
"x-api-user": username,
|
"x-api-user": username,
|
||||||
"x-api-key": credentials,
|
"x-api-key": credentials,
|
||||||
},
|
},
|
||||||
|
|
@ -20,7 +20,20 @@ export async function scoreTask(username: string, credentials: string, taskID: s
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"x-client": username.concat("-testAPI"),
|
"x-client": "278e719e-5f9c-43b1-9dba-8b73343dc062-HabiticaSync",
|
||||||
|
"x-api-user": username,
|
||||||
|
"x-api-key": credentials,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return(response)
|
||||||
|
}
|
||||||
|
export async function makeCronReq(username: string, credentials: string, taskID: string){
|
||||||
|
const url = "https://habitica.com/api/v3/cron";
|
||||||
|
const response = fetch(url, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"x-client": "278e719e-5f9c-43b1-9dba-8b73343dc062-HabiticaSync",
|
||||||
"x-api-user": username,
|
"x-api-user": username,
|
||||||
"x-api-key": credentials,
|
"x-api-key": credentials,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue