all consent api was split into 3 object to make it more GDPR friendly

This commit is contained in:
Yuli
2020-07-01 12:13:16 +03:00
parent 1f973ea878
commit 00b7bddec8
12 changed files with 910 additions and 311 deletions

View File

@@ -142,7 +142,7 @@ func (e mainEnv) getUserRequest(w http.ResponseWriter, r *http.Request, ps httpr
if len(appName) > 0 {
resultJSON, err = e.db.getUserApp(userTOKEN, appName)
} else if len(brief) > 0 {
resultJSON, err = e.db.viewConsentRecord(userTOKEN, brief)
resultJSON, err = e.db.viewAgreementRecord(userTOKEN, brief)
} else {
resultJSON, err = e.db.getUser(userTOKEN)
}
@@ -251,11 +251,11 @@ func (e mainEnv) approveUserRequest(w http.ResponseWriter, r *http.Request, ps h
returnError(w, r, "internal error", 405, err, event)
return
}
} else if action == "consent-withdraw" {
} else if action == "agreement-withdraw" {
brief := requestInfo["brief"].(string)
mode := "token"
lastmodifiedby := "admin"
e.db.withdrawConsentRecord(userTOKEN, brief, mode, userTOKEN, lastmodifiedby)
e.db.withdrawAgreement(userTOKEN, brief, mode, userTOKEN, lastmodifiedby)
}
e.db.updateRequestStatus(request, "approved", "")
w.Header().Set("Content-Type", "application/json; charset=utf-8")