feat: add progress to tasks
This commit is contained in:
@@ -4,6 +4,8 @@ import { integer, pgTable, serial, timestamp, varchar } from 'drizzle-orm/pg-cor
|
|||||||
export const tasks = pgTable('tasks', {
|
export const tasks = pgTable('tasks', {
|
||||||
id: serial('id').primaryKey(),
|
id: serial('id').primaryKey(),
|
||||||
name: varchar('name', { length: 256 }),
|
name: varchar('name', { length: 256 }),
|
||||||
|
currentPoints: integer('current_points').default(0),
|
||||||
|
totalPoints: integer('total_points').default(1),
|
||||||
createdAt: timestamp('created_at').defaultNow(),
|
createdAt: timestamp('created_at').defaultNow(),
|
||||||
updatedAt: timestamp('updated_at').defaultNow()
|
updatedAt: timestamp('updated_at').defaultNow()
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="px-6 py-2 border-b">
|
<td class="px-6 py-2 border-b">
|
||||||
{task.progress}%
|
{((task.currentPoints / task.totalPoints) * 100).toFixed(1)}%
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-2 border-b">
|
<td class="px-6 py-2 border-b">
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user