🐛 Fix notification order... again

This commit is contained in:
LittleSheep 2024-10-16 21:07:53 +08:00
parent 10d977ab23
commit e83e92b054
2 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@
<option name="autoReloadType" value="ALL" /> <option name="autoReloadType" value="ALL" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Bug fixes on compile time"> <list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Fix notification order">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/server/api/notifications_api.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/server/api/notifications_api.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pkg/internal/server/api/notifications_api.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/server/api/notifications_api.go" afterDir="false" />
</list> </list>
@ -153,7 +153,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value=":bug: Fix preloading issue" />
<MESSAGE value=":bug: Fix bot related key api issue" /> <MESSAGE value=":bug: Fix bot related key api issue" />
<MESSAGE value=":bug: Fix query statement column issue" /> <MESSAGE value=":bug: Fix query statement column issue" />
<MESSAGE value=":sparkles: Daily signs" /> <MESSAGE value=":sparkles: Daily signs" />
@ -178,7 +177,8 @@
<MESSAGE value=":bug: Bug fixes in non-cached notification preferences" /> <MESSAGE value=":bug: Bug fixes in non-cached notification preferences" />
<MESSAGE value=":alien: Support better metadata encoder / decoder" /> <MESSAGE value=":alien: Support better metadata encoder / decoder" />
<MESSAGE value=":bug: Bug fixes on compile time" /> <MESSAGE value=":bug: Bug fixes on compile time" />
<option name="LAST_COMMIT_MESSAGE" value=":bug: Bug fixes on compile time" /> <MESSAGE value=":bug: Fix notification order" />
<option name="LAST_COMMIT_MESSAGE" value=":bug: Fix notification order" />
</component> </component>
<component name="VgoProject"> <component name="VgoProject">
<settings-migrated>true</settings-migrated> <settings-migrated>true</settings-migrated>

View File

@ -32,7 +32,7 @@ func getNotifications(c *fiber.Ctx) error {
if err := tx. if err := tx.
Limit(take). Limit(take).
Offset(offset). Offset(offset).
Order("read_at DESC, created_at"). Order("read_at DESC, created_at DESC").
Find(&notifications).Error; err != nil { Find(&notifications).Error; err != nil {
return fiber.NewError(fiber.StatusInternalServerError, err.Error()) return fiber.NewError(fiber.StatusInternalServerError, err.Error())
} }