fixed error with duplicate stringify operation in api routes
Co-authored-by: Spacelord <Spacelord09@users.noreply.github.com>
This commit is contained in:
@ -2,9 +2,7 @@ function getDataForEdit(name) {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: `/api/v1/categories?name=${name}`,
|
||||
success: function (data) {
|
||||
const result = JSON.parse(data);
|
||||
|
||||
success: function (result) {
|
||||
// Get elements inside the editCategoryModal
|
||||
const modal_categoryName = document.getElementById('editCategoryModalName');
|
||||
const modal_categoryDescription = document.getElementById('editCategoryModalDescription');
|
||||
|
@ -19,8 +19,7 @@ function getDataForEdit(id) {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: `/api/v1/items?id=${id}`,
|
||||
success: function (data) {
|
||||
const result = JSON.parse(data);
|
||||
success: function (result) {
|
||||
|
||||
// Get elements inside the editCategoryModal
|
||||
const modal_itemName = document.getElementById('itemModifyModalName');
|
||||
|
@ -68,8 +68,7 @@ function getDataForEdit(id) {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: `/api/v1/storageUnits?id=${id}`,
|
||||
success: function (data) {
|
||||
const result = JSON.parse(data);
|
||||
success: function (result) {
|
||||
|
||||
// Get elements inside the editCategoryModal
|
||||
const modal_unitName = document.getElementById('storageUnitModalName');
|
||||
@ -107,8 +106,7 @@ function getDataForEditLoc(id) {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: `/api/v1/storageLocations?id=${id}`,
|
||||
success: function (data) {
|
||||
const result = JSON.parse(data);
|
||||
success: function (result) {
|
||||
|
||||
// Get elements inside the editCategoryModal
|
||||
const modal_locationName = document.getElementById('storageLocationModalName');
|
||||
|
@ -108,8 +108,7 @@ function preFillDeleteModalNxt(id, route, name, requestIdent='id') {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: `/api/v1/${route}?${requestIdent}=${id}`,
|
||||
success: function (data) {
|
||||
const result = JSON.parse(data);
|
||||
success: function (result) {
|
||||
|
||||
// Get elements inside the editCategoryModal
|
||||
const modal_categoryName = document.getElementById('deleteNamePlaceholder');
|
||||
|
@ -23,8 +23,7 @@ function loadPageData() {
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function dataResponseHandler(res) {
|
||||
json = JSON.parse(res);
|
||||
function dataResponseHandler(json) {
|
||||
// console.log(json)
|
||||
totalNotFiltered = json.totalNotFiltered;
|
||||
total = json.total;
|
||||
|
@ -67,8 +67,7 @@ function handleSearchChange(e) {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: url,
|
||||
success: function (data) {
|
||||
let result = JSON.parse(data);
|
||||
success: function (result) {
|
||||
let htmlResult = ""
|
||||
result.forEach(element => {
|
||||
console.log(element);
|
||||
|
Reference in New Issue
Block a user