wip
This commit is contained in:
@@ -31,7 +31,7 @@ type User struct {
|
||||
Username string
|
||||
}
|
||||
|
||||
type RepositoryAction struct {
|
||||
type RepositoryWebhookEvent struct {
|
||||
Action string
|
||||
|
||||
Sender *User
|
||||
@@ -41,13 +41,17 @@ type RepositoryAction struct {
|
||||
PrjGit string
|
||||
}
|
||||
|
||||
func (r *RepositoryWebhookEvent) GetAction() string {
|
||||
return r.Action
|
||||
}
|
||||
|
||||
// TODO: sanity check values!!!!
|
||||
func (h *RequestHandler) parseRepositoryRequest(dataReader io.Reader) *RepositoryAction {
|
||||
func (h *RequestHandler) parseRepositoryRequest(dataReader io.Reader) *RepositoryWebhookEvent {
|
||||
if h.HasError() {
|
||||
return nil
|
||||
}
|
||||
|
||||
var data RepositoryAction
|
||||
var data RepositoryWebhookEvent
|
||||
h.Error = json.NewDecoder(dataReader).Decode(&data)
|
||||
|
||||
if h.HasError() {
|
||||
@@ -69,6 +73,6 @@ func (h *RequestHandler) parseRepositoryRequest(dataReader io.Reader) *Repositor
|
||||
h.ErrLogger.Println("Request has no data.... skipping")
|
||||
}
|
||||
|
||||
h.Data = data
|
||||
h.Request.Data = &data
|
||||
return &data
|
||||
}
|
||||
|
Reference in New Issue
Block a user