Basic New Task
Some checks failed
Build BAB Application Deployment Artifact / build (push) Failing after 2m7s
Some checks failed
Build BAB Application Deployment Artifact / build (push) Failing after 2m7s
This commit is contained in:
@@ -3,7 +3,7 @@ import { defineStore } from 'pinia';
|
||||
// const boatSource = null;
|
||||
|
||||
export interface Boat {
|
||||
id: number;
|
||||
$id: string;
|
||||
name: string;
|
||||
displayName?: string;
|
||||
class?: string;
|
||||
@@ -26,7 +26,7 @@ export interface Boat {
|
||||
|
||||
const getSampleData = () => [
|
||||
{
|
||||
id: 1,
|
||||
$id: '1',
|
||||
name: 'ProjectX',
|
||||
displayName: 'PX',
|
||||
class: 'J/27',
|
||||
@@ -52,7 +52,7 @@ and rough engine performance.`,
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
$id: '2',
|
||||
name: 'Take5',
|
||||
displayName: 'T5',
|
||||
class: 'J/27',
|
||||
@@ -61,7 +61,7 @@ and rough engine performance.`,
|
||||
iconsrc: '/tmpimg/take5_avatar32.png',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
$id: '3',
|
||||
name: 'WeeBeestie',
|
||||
displayName: 'WB',
|
||||
class: 'Capri 25',
|
||||
|
||||
@@ -2,12 +2,9 @@ import { defineStore } from 'pinia';
|
||||
import { AppwriteIds, databases, ID } from 'src/boot/appwrite';
|
||||
import type { Models } from 'appwrite';
|
||||
|
||||
export enum TASKSTATUS {
|
||||
READY = 'ready',
|
||||
COMPLETE = 'complete',
|
||||
WAITING = 'waiting',
|
||||
}
|
||||
export interface Task extends Models.Document {
|
||||
export const TASKSTATUS = ['ready', 'complete', 'waiting', 'archived'];
|
||||
|
||||
export interface Task extends Partial<Models.Document> {
|
||||
title: string;
|
||||
description: string;
|
||||
required_skills: string[];
|
||||
@@ -16,9 +13,8 @@ export interface Task extends Models.Document {
|
||||
duration: number;
|
||||
volunteers: string[];
|
||||
volunteers_required: number;
|
||||
status: TASKSTATUS;
|
||||
depends_on: string;
|
||||
completed: boolean;
|
||||
status: string;
|
||||
depends_on: string[];
|
||||
boat: string;
|
||||
} // TODO: convert some of these strings into objects.
|
||||
|
||||
@@ -59,7 +55,7 @@ export const useTaskStore = defineStore('tasks', {
|
||||
);
|
||||
this.taskTags = response.documents as TaskTag[];
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch tasks', error);
|
||||
console.error('Failed to fetch task tags', error);
|
||||
}
|
||||
},
|
||||
async fetchSkillTags() {
|
||||
@@ -71,7 +67,7 @@ export const useTaskStore = defineStore('tasks', {
|
||||
);
|
||||
this.skillTags = response.documents as SkillTag[];
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch tasks', error);
|
||||
console.error('Failed to fetch skill tags', error);
|
||||
}
|
||||
},
|
||||
async addTask(task: Task) {
|
||||
@@ -87,6 +83,15 @@ export const useTaskStore = defineStore('tasks', {
|
||||
console.error('Failed to add task:', error);
|
||||
}
|
||||
},
|
||||
// TODO: Enhance this store to include offline caching, and subscription notification when items change on the server.
|
||||
|
||||
filterTasks(searchQuery: string) {
|
||||
const result = this.tasks.filter((task) =>
|
||||
task.title.toLowerCase().includes(searchQuery.toLowerCase())
|
||||
);
|
||||
console.log(result);
|
||||
return result;
|
||||
},
|
||||
},
|
||||
// Add more actions as needed (e.g., updateTask, deleteTask)
|
||||
getters: {
|
||||
|
||||
Reference in New Issue
Block a user