@shubhamk15 wrote:
Please help me, I am stuck at this error for so long and couldn’t find out what’s going on. Thank you!
config-groups.js
var app = angular.module(‘config-groups’,[‘ngResource’,‘ui.bootstrap’,‘ui.sortable’,‘angularFileUpload’]);app.controller(‘DisplayErrorCtrl’, function ($scope, $modalInstance, error) {
$scope.error=error;
$scope.ok = function () {
$modalInstance.close($scope.properties);
};});
function RowBulkController($scope,$modal,$timeout,$log,$resource,$upload,$http) {
$scope.updateRowName = () => {
$http.post(’/menueditor/angular/rss-row/’).success(
function (response, status, headers, config) {
console.log(response);
$modal.open({templateUrl: ‘displayError.html’,
controller: ‘DisplayErrorCtrl’,
size: ‘md’,
resolve: {
error: () => ‘Successful’
}
});
});
};
}urls.py
url(r’^angular/rss-row/$’, views.config_groups.add_row_name, name=‘rss-row’),
config_groups.py
def add_row_name(request):
“”" Adds name to rows “”"
if request.method == ‘POST’:
r = json.loads(request.body)
rowname = r[‘row_name’]
if not rowname:
return JsonResponse({‘success’: False, ‘error’: ‘Row name must be filled out.’})
object_cg = ConfigGroupRow.objects.filter(id=r[‘row_id’])
object_cg.name = rowname
object_cg.save()
return JsonResponse({‘success’: True})
return JsonResponse({‘success’: False})
Posts: 1
Participants: 1