File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
src/routes/[username]/[slug]/config Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -31,12 +31,29 @@ export const GET: RequestHandler = async ({ platform, params }) => {
3131
3232 const packages = JSON . parse ( config . packages || '[]' ) ;
3333
34+ let taps : string [ ] = [ ] ;
35+ const snapshotRow = await env . DB . prepare (
36+ 'SELECT snapshot FROM configs WHERE user_id = ? AND slug = ?'
37+ )
38+ . bind ( user . id , params . slug )
39+ . first < { snapshot : string } > ( ) ;
40+
41+ if ( snapshotRow ?. snapshot ) {
42+ try {
43+ const snapshot = JSON . parse ( snapshotRow . snapshot ) ;
44+ taps = snapshot . packages ?. taps || [ ] ;
45+ } catch {
46+ taps = [ ] ;
47+ }
48+ }
49+
3450 return json ( {
3551 username : user . username ,
3652 slug : config . slug ,
3753 name : config . name ,
3854 preset : config . base_preset ,
3955 packages : packages ,
56+ taps : taps ,
4057 dotfiles_repo : config . dotfiles_repo || ''
4158 } ) ;
4259} ;
You can’t perform that action at this time.
0 commit comments