-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The demo shows how the Models SDK can be used to show changes to the issue data rendered in the exanded drawer. We have not integrated Models to render changes to the list view yet. In the meantime, we simply reload the issues for the list view from the server.
- Loading branch information
1 parent
f491d9f
commit 76dd3fd
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use server'; | ||
|
||
import { sql } from '@/data'; | ||
import { IssueType } from '../Table'; | ||
|
||
export const fetchIssues = async (id: number) => { | ||
const issues = await sql<IssueType[]>` | ||
SELECT | ||
i.id, | ||
i.name, | ||
i.due_date, | ||
i.status, | ||
i.owner_id, | ||
i.story_points, | ||
i.description, | ||
u.first_name as owner_first_name, | ||
u.last_name as owner_last_name, | ||
u.color as owner_color | ||
FROM issues i | ||
LEFT OUTER JOIN users u | ||
ON u.id = i.owner_id | ||
WHERE project_id = ${id} | ||
ORDER BY i.id DESC | ||
`; | ||
|
||
return Array.from(issues); | ||
}; |