-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
251 additions
and
49 deletions.
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
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
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 @@ | ||
package models | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/skylight-hq/phinvads-go/internal/database/models/xo" | ||
) | ||
|
||
// All retrieves all rows from 'public.hot_topic' | ||
func GetAllHotTopics(ctx context.Context, db xo.DB) (*[]xo.HotTopic, error) { | ||
const sqlstr = `SELECT * FROM public.hot_topic` | ||
hotTopics := []xo.HotTopic{} | ||
rows, err := db.QueryContext(ctx, sqlstr) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
for rows.Next() { | ||
ht := xo.HotTopic{} | ||
err := rows.Scan(&ht.HotTopicID, &ht.HotTopicName, &ht.HotTopicDescription, &ht.Seq, &ht.EffectiveDate, &ht.ExpiryDate, &ht.DeploymentDate, &ht.CreatedDate, &ht.UpdatedDate) | ||
if err != nil { | ||
return nil, err | ||
} | ||
hotTopics = append(hotTopics, ht) | ||
} | ||
return &hotTopics, nil | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,10 @@ | ||
package components | ||
|
||
templ HotTopic(topic_name string, topic_description, sequence, topic_id string ) { | ||
<button id={topic_id} type="button" class="usa-accordion__button" aria-expanded="false" aria-controls={sequence}> | ||
{topic_name} | ||
</button> | ||
<div id={sequence} class="usa-accordion__content usa-prose" hidden> | ||
<p>{topic_description}</p> | ||
</div> | ||
} |