root 4 éve
szülő
commit
54a1a4935a
1 módosított fájl, 43 hozzáadás és 1 törlés
  1. 43 1
      index.js

+ 43 - 1
index.js

@@ -1479,7 +1479,49 @@ function getlxfilebyid(id) {
   if (_token) {
     $.ajax(`/api/web/v1/blockpy/project/` + id, {
       type: "GET",
-      headers: { 'Authorization': "Bearer " + _token  },
+      headers: { 'Authorization': "Bearer " + _token },
+      success: (data) => {
+        cb(data)
+      }
+    });
+  }
+}
+
+function dellxfilebyid(id) {
+  var _token = window.localStorage.Token;
+  if (_token) {
+    $.ajax(`/api/web/v1/blockpy/project/del/` + id, {
+      type: "GET",
+      headers: { 'Authorization': "Bearer " + _token },
+      success: (data) => {
+        cb(data)
+      }
+    });
+  }
+}
+
+function upadtelxfilenamebyid(id, title) {
+  var _token = window.localStorage.Token;
+  if (_token) {
+    $.ajax(`/api/web/v1/blockpy/project/title/update`, {
+      type: "POST",
+      headers: { 'Authorization': "Bearer " + _token, 'content-type': "application/json;charset=UTF-8" },
+      data: { id: id, title: title },
+      success: (data) => {
+        cb(data)
+      }
+    });
+  }
+}
+
+
+function uploadlxfilecontentbyid(id, code) {
+  var _token = window.localStorage.Token;
+  if (_token) {
+    $.ajax(`/api/web/v1/blockpy/project/code/update`, {
+      type: "POST",
+      headers: { 'Authorization': "Bearer " + _token, 'content-type': "application/json;charset=UTF-8" },
+      data: { id: id, code: code },
       success: (data) => {
         cb(data)
       }