Skip to content

Commit

Permalink
Merge pull request #1314 from yogeshojha/1310-can-use-note
Browse files Browse the repository at this point in the history
Fix Not able to add todo from All Subdomains Section Fixes #1310
  • Loading branch information
yogeshojha authored Jul 20, 2024
2 parents 063c82e + 9586d0d commit 7ee03c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
5 changes: 0 additions & 5 deletions web/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,6 @@ def post(self, request):
data = req.data

subdomain_id = data.get('subdomain_id')
scan_history_id = data.get('scan_history_id')
title = data.get('title')
description = data.get('description')
project = data.get('project')
Expand All @@ -577,10 +576,6 @@ def post(self, request):
note.title = title
note.description = description

if scan_history_id:
scan_history = ScanHistory.objects.get(id=scan_history_id)
note.scan_history = scan_history

# get scan history for subdomain_id
if subdomain_id:
subdomain = Subdomain.objects.get(id=subdomain_id)
Expand Down
10 changes: 6 additions & 4 deletions web/recon_note/static/note/js/todo.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,20 @@ function populateTodofunction(project=null){
'description': $_taskDescriptionText
}

if ($("#scanHistoryIDropdown").val() && $("#scanHistoryIDropdown").val() != 'Choose Scan History...') {
data['scan_history'] = parseInt($("#scanHistoryIDropdown").val());
}
// if ($("#scanHistoryIDropdown").val() && $("#scanHistoryIDropdown").val() != 'Choose Scan History...') {
// data['scan_history'] = parseInt($("#scanHistoryIDropdown").val());
// }

if ($("#subdomainDropdown").val() != 'Choose Subdomain...') {
data['subdomain'] = parseInt($("#subdomainDropdown").val());
data['subdomain_id'] = parseInt($("#subdomainDropdown").val());
}

if (project) {
data['project'] = project;
}

console.log(data);

fetch('/api/add/recon_note/', {
method: 'post',
headers: {
Expand Down
4 changes: 2 additions & 2 deletions web/startScan/static/startScan/js/detail_scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -1173,16 +1173,16 @@ function add_note_for_subdomain_handler(subdomain_id){
var title = document.getElementById('subdomainTodoTitle').value;
var description = document.getElementById('subdomainTodoDescription').value;
var project = document.querySelector('input[name="current_project"]').value;
var scan_id = parseInt(document.getElementById('summary_identifier_val').value);

data = {
'title': title,
'description': description,
'subdomain_id': subdomain_id,
'project': project,
'scan_history_id': scan_id
}

console.log(data);

fetch('/api/add/recon_note/', {
method: 'post',
headers: {
Expand Down

0 comments on commit 7ee03c5

Please sign in to comment.