TP-5555 | last seen support
This commit is contained in:
@@ -79,27 +79,27 @@ func (s *SourceMapService) GetSourceMapUploadUrl(ctx *gin.Context) {
|
||||
}
|
||||
|
||||
func (s *SourceMapService) SourceMapUploadAck(c *gin.Context) {
|
||||
var sourceMapAckBody SourceMapAckBody
|
||||
if err := c.BindJSON(&sourceMapAckBody); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
//find the record to update ack
|
||||
var existingSourceMap db.SourceMap
|
||||
existingRecordError := s.dbClient.First(&existingSourceMap, "project_reference_id = ? and release_reference_id= ? and file_name = ?", sourceMapAckBody.ProjectReferenceId, sourceMapAckBody.ReleaseId, sourceMapAckBody.FileName).Error
|
||||
if existingRecordError != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": existingRecordError.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
existingSourceMap.State = "DONE"
|
||||
|
||||
err := s.dbClient.Save(&existingSourceMap).Error
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
//var sourceMapAckBody SourceMapAckBody
|
||||
//if err := c.BindJSON(&sourceMapAckBody); err != nil {
|
||||
// c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
// return
|
||||
//}
|
||||
//
|
||||
////find the record to update ack
|
||||
//var existingSourceMap db.SourceMap
|
||||
//existingRecordError := s.dbClient.First(&existingSourceMap, "project_reference_id = ? and release_reference_id= ? and file_name = ?", sourceMapAckBody.ProjectReferenceId, sourceMapAckBody.ReleaseId, sourceMapAckBody.FileName).Error
|
||||
//if existingRecordError != nil {
|
||||
// c.JSON(http.StatusBadRequest, gin.H{"error": existingRecordError.Error()})
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//existingSourceMap.State = "DONE"
|
||||
//
|
||||
//err := s.dbClient.Save(&existingSourceMap).Error
|
||||
//if err != nil {
|
||||
// c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
// return
|
||||
//}
|
||||
c.JSON(http.StatusOK, gin.H{"status": "Source map stored successfully"})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user