add task function
This commit is contained in:
parent
67af22829f
commit
070b437bab
6 changed files with 47 additions and 37 deletions
|
|
@ -54,3 +54,19 @@ export async function costReward(username: string, credentials: string, taskID:
|
|||
})
|
||||
return(response)
|
||||
}
|
||||
|
||||
|
||||
export async function addDaily(username: string, credentials: string, title: string) {
|
||||
const url = "https://habitica.com/api/v4/tasks/user".concat(title)
|
||||
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-key": credentials,
|
||||
},
|
||||
body: JSON.stringify({type: "daliy", text: title})
|
||||
})
|
||||
return(response)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue