modified th api's for bin, contract and task to have as passed in as a prop and not get it ffrom the global state directly in the api

This commit is contained in:
csawatzky 2025-04-17 13:33:27 -06:00
parent 4bcac4e346
commit e2f5eb0557
31 changed files with 155 additions and 507 deletions

View file

@ -119,7 +119,7 @@ export default function TaskSettings(props: Props) {
returnTask.settings = taskSettings;
taskAPI
.addTask(taskSettings)
.addTask(taskSettings, as)
.then(resp => {
props.onClose(true);
})
@ -145,7 +145,7 @@ export default function TaskSettings(props: Props) {
: 0;
taskAPI
.updateTask(task.key, task.settings)
.updateTask(task.key, task.settings, undefined, as)
.then(resp => {
props.onClose(true);
})

View file

@ -144,7 +144,7 @@ export default function TaskViewer(props: ViewProps) {
let temp = new Map<string, Task>();
setLoaded(false);
taskAPI
.getMultiTasks(loadKeys)
.getMultiTasks(loadKeys, as)
.then(resp => {
resp.data.tasks.forEach(task => {
if (task.settings) {
@ -158,7 +158,7 @@ export default function TaskViewer(props: ViewProps) {
openSnack("Failed to load");
});
}
}, [loadKeys, openSnack, taskAPI]);
}, [loadKeys, openSnack, taskAPI, as]);
//loads tasks from the backend database
const loadTasks = useCallback(() => {
@ -194,7 +194,7 @@ export default function TaskViewer(props: ViewProps) {
task.settings.complete = !task.settings.complete;
taskAPI
.updateTask(task.key, task.settings)
.updateTask(task.key, task.settings, undefined, as)
.then(resp => {
openSnack("Task Updated");
loadTasks();
@ -206,7 +206,7 @@ export default function TaskViewer(props: ViewProps) {
const deleteTask = (task: Task) => {
taskAPI
.removeTask(task.key)
.removeTask(task.key, as)
.then(resp => {
openSnack("Task Removed");
loadTasks();