mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 02:04:11 +01:00 
			
		
		
		
	* BEAKING: check return status based on struct not httpStatus * update Tests * CI.restart()
		
			
				
	
	
		
			25 lines
		
	
	
		
			708 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			708 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright 2020 The Gitea Authors. All rights reserved.
 | 
						|
// Use of this source code is governed by a MIT-style
 | 
						|
// license that can be found in the LICENSE file.
 | 
						|
 | 
						|
package notify
 | 
						|
 | 
						|
import (
 | 
						|
	"net/http"
 | 
						|
 | 
						|
	"code.gitea.io/gitea/models"
 | 
						|
	"code.gitea.io/gitea/modules/context"
 | 
						|
	api "code.gitea.io/gitea/modules/structs"
 | 
						|
)
 | 
						|
 | 
						|
// NewAvailable check if unread notifications exist
 | 
						|
func NewAvailable(ctx *context.APIContext) {
 | 
						|
	// swagger:operation GET /notifications/new notification notifyNewAvailable
 | 
						|
	// ---
 | 
						|
	// summary: Check if unread notifications exist
 | 
						|
	// responses:
 | 
						|
	//   "200":
 | 
						|
	//     "$ref": "#/responses/NotificationCount"
 | 
						|
	ctx.JSON(http.StatusOK, api.NotificationCount{New: models.CountUnread(ctx.User)})
 | 
						|
}
 |