Implemented tech section of portfolio projects

Added order for portfolio projects
This commit is contained in:
Caleb Gardner
2024-08-07 03:22:05 -05:00
parent b7c63ca794
commit 1e9eeb25d1
3 changed files with 6 additions and 1 deletions
+2
View File
@@ -58,6 +58,7 @@ Return:
```json
{
id: "blogID",
staticPage: false, // static pages don't show up alongside other blog pages.
createTime: 0, // creation time in Unix format
updateTime: 0, // last update time in Unix format
author: "authorID",
@@ -170,6 +171,7 @@ Return:
[
{
title: "Darkstorm Server",
order: 0,
repository: "https://github.com/CalebQ42/darkstorm-server",
description: "The backend that runs runs my website and APIs",
technologies: [ // May be empty
+2 -1
View File
@@ -12,6 +12,7 @@ import (
type PortfolioProject struct {
Title string `json:"_id" bson:"_id"`
Order int `json:"order" bson:"order"`
Repository string `json:"repository" bson:"repository"`
Description string `json:"description" bson:"description"`
Technologies []string `json:"technologies" bson:"technologies"`
@@ -26,7 +27,7 @@ func (b *BlogApp) Projects(languageFilter string) ([]PortfolioProject, error) {
if languageFilter != "" {
filter["language.language"] = languageFilter
}
res, err := b.portfolioCol.Find(context.Background(), filter, options.Find().SetSort(bson.M{"_id": 1}))
res, err := b.portfolioCol.Find(context.Background(), filter, options.Find().SetSort(bson.M{"order": 1}))
if err != nil {
return nil, err
}