Commit 57668c5c authored by Kaustubh Negi's avatar Kaustubh Negi

23-02-2023

parent 2b43bb90
...@@ -66,11 +66,32 @@ fetchActivities() { ...@@ -66,11 +66,32 @@ fetchActivities() {
saveInputs() { saveInputs() {
// Code to save the inputs // Code to save the inputs
console.log(this.inputs); console.log(this.inputs);
this.postInput();
} }
onInputChange(index: number, field: string, value: string| number) { onInputChange(index: number, field: string, value: string| number) {
console.log(`Input at index ${index} for field ${field} changed to ${value}`); console.log(`Input at index ${index} for field ${field} changed to ${value}`);
} }
//
postInput() {
// const data = [1, 2, 3];
const url = 'http://localhost:3000/daysactivity';
let token:string ="";
let json: string | null = localStorage.getItem("response");
if (json) {
console.log("json "+json);
token = JSON.parse(json).token;
console.log(token);
}
const headers = {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
};
this.http.post(url, {inputs:this.inputs},{headers}).subscribe(response => {
console.log(response);
});
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment