🐛 Fix notification order
This commit is contained in:
		
							
								
								
									
										8
									
								
								.idea/workspace.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										8
									
								
								.idea/workspace.xml
									
									
									
										generated
									
									
									
								
							@@ -4,9 +4,9 @@
 | 
			
		||||
    <option name="autoReloadType" value="ALL" />
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="ChangeListManager">
 | 
			
		||||
    <list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":alien: Support better metadata encoder / decoder">
 | 
			
		||||
    <list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Bug fixes on compile time">
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
 | 
			
		||||
      <change beforePath="$PROJECT_DIR$/pkg/internal/grpc/realms.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/grpc/realms.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>
 | 
			
		||||
    <option name="SHOW_DIALOG" value="false" />
 | 
			
		||||
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
 | 
			
		||||
@@ -153,7 +153,6 @@
 | 
			
		||||
    </option>
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="VcsManagerConfiguration">
 | 
			
		||||
    <MESSAGE value=":sparkles: Preload api key's ticket" />
 | 
			
		||||
    <MESSAGE value=":bug: Fix preloading issue" />
 | 
			
		||||
    <MESSAGE value=":bug: Fix bot related key api issue" />
 | 
			
		||||
    <MESSAGE value=":bug: Fix query statement column issue" />
 | 
			
		||||
@@ -178,7 +177,8 @@
 | 
			
		||||
    <MESSAGE value=":sparkles: New login alert" />
 | 
			
		||||
    <MESSAGE value=":bug: Bug fixes in non-cached notification preferences" />
 | 
			
		||||
    <MESSAGE value=":alien: Support better metadata encoder / decoder" />
 | 
			
		||||
    <option name="LAST_COMMIT_MESSAGE" value=":alien: Support better metadata encoder / decoder" />
 | 
			
		||||
    <MESSAGE value=":bug: Bug fixes on compile time" />
 | 
			
		||||
    <option name="LAST_COMMIT_MESSAGE" value=":bug: Bug fixes on compile time" />
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="VgoProject">
 | 
			
		||||
    <settings-migrated>true</settings-migrated>
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@ func getNotifications(c *fiber.Ctx) error {
 | 
			
		||||
	if err := tx.
 | 
			
		||||
		Limit(take).
 | 
			
		||||
		Offset(offset).
 | 
			
		||||
		Order("CASE WHEN read_at IS NULL THEN 0 ELSE 1 END, created_at").
 | 
			
		||||
		Order("read_at DESC, created_at").
 | 
			
		||||
		Find(¬ifications).Error; err != nil {
 | 
			
		||||
		return fiber.NewError(fiber.StatusInternalServerError, err.Error())
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user