Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add open content dashboard ui and activity apis #532

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

calisio
Copy link
Contributor

@calisio calisio commented Nov 25, 2024

Description of the change

Screenshot(s)

If only open content is turned on, the user will see the open content dashboard. If something else is also turned on, they will see the admin/student dashboard- this will be changed as we add the dashboards for different levels.

Screenshot 2024-11-25 at 4 31 49 PM

Additional context

In sprint planning today I mentioned I would filter the top 5 resources, but I have decided to do that in a different PR since I will have to change the handler and the DB call. This PR just grabs all resources and displays them on the dashboard.

@@ -165,3 +165,44 @@ func (db *DB) GetUserFavorites(userID uint, page, perPage int) (int64, []models.
paginatedFavorites := allFavorites[offset:end]
return total, paginatedFavorites, nil
}

func (db *DB) GetTopFacilityOpenContent(id int) ([]models.OpenContentItem, error) {
var content []models.OpenContentItem
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you mentioned* initialize this array to 5. e.g.

content := make([]models.OpenContentItem, 0, 5)

@PThorpe92 PThorpe92 merged commit a4e8ef5 into UnlockedLabs:main Nov 26, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants