You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
p.writeAPIError(w, &serializer.APIErrorResponse{ID: "", Message: fmt.Sprintf("failed to load the post %s", req.PostID), StatusCode: http.StatusInternalServerError})
974
-
return
975
-
}
976
-
ifpost==nil {
977
-
p.writeAPIError(w, &serializer.APIErrorResponse{ID: "", Message: fmt.Sprintf("failed to load the post %s : not found", req.PostID), StatusCode: http.StatusNotFound})
978
-
return
979
-
}
980
-
981
-
p.API.PublishWebSocketEvent(
982
-
wsEventAttachCommentToIssue,
983
-
map[string]interface{}{
984
-
"postId": post.Id,
985
-
"owner": req.RepoOwner,
986
-
"repo": req.RepoName,
987
-
"number": req.IssueNumber,
988
-
},
989
-
&model.WebsocketBroadcast{UserId: userID},
990
-
)
991
-
}
992
-
993
-
func (p*Plugin) openCloseOrReopenIssueModal(c*serializer.UserContext, w http.ResponseWriter, r*http.Request) {
p.writeAPIError(w, &serializer.APIErrorResponse{ID: "", Message: fmt.Sprintf("failed to load the post %s", req.PostID), StatusCode: http.StatusInternalServerError})
1006
-
return
1007
-
}
1008
-
ifpost==nil {
1009
-
p.writeAPIError(w, &serializer.APIErrorResponse{ID: "", Message: fmt.Sprintf("failed to load the post %s : not found", req.PostID), StatusCode: http.StatusNotFound})
1010
-
return
1011
-
}
1012
-
1013
-
p.API.PublishWebSocketEvent(
1014
-
wsEventCloseOrReopenIssue,
1015
-
map[string]interface{}{
1016
-
"channel_id": post.ChannelId,
1017
-
"owner": req.RepoOwner,
1018
-
"repo": req.RepoName,
1019
-
"number": req.IssueNumber,
1020
-
"status": req.Status,
1021
-
"postId": req.PostID,
1022
-
},
1023
-
&model.WebsocketBroadcast{UserId: userID},
1024
-
)
1025
-
}
960
+
func (p*Plugin) getIssueInfo(c*serializer.UserContext, w http.ResponseWriter, r*http.Request) {
961
+
owner:=r.FormValue(constants.OwnerQueryParam)
962
+
repo:=r.FormValue(constants.RepoQueryParam)
963
+
number:=r.FormValue(constants.NumberQueryParam)
964
+
postID:=r.FormValue(constants.PostIDQueryParam)
1026
965
1027
-
func (p*Plugin) openIssueEditModal(c*serializer.UserContext, w http.ResponseWriter, r*http.Request) {
p.writeAPIError(w, &serializer.APIErrorResponse{ID: "", Message: fmt.Sprintf("failed to load the post %s", req.PostID), StatusCode: http.StatusInternalServerError})
1022
+
p.writeAPIError(w, &serializer.APIErrorResponse{ID: "", Message: fmt.Sprintf("failed to load the post %s", postID), StatusCode: http.StatusInternalServerError})
1087
1023
return
1088
1024
}
1089
1025
ifpost==nil {
1090
-
p.writeAPIError(w, &serializer.APIErrorResponse{ID: "", Message: fmt.Sprintf("failed to load the post %s : not found", req.PostID), StatusCode: http.StatusNotFound})
1026
+
p.writeAPIError(w, &serializer.APIErrorResponse{ID: "", Message: fmt.Sprintf("failed to load the post %s : not found", postID), StatusCode: http.StatusNotFound})
0 commit comments