Update Eintrag.lua

This commit is contained in:
Marcel Lorbeer 2023-10-01 02:43:59 +02:00 committed by GitHub
parent dc34b97bc5
commit 1b5d10dc62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
local Utils = require(script.Parent.Parent.Dienstprogramme) local Utils = require(script.Parent.Parent.Dienstprogramme)
local types = { local types = {
EntryData = require(script.Parent.Parent.Types.EntryData).bekommeRassenindentifikationsspezifizierunginstanztextaufzaehlbar() EntryData = require(script.Parent.Parent.Types.EintragsDaten).bekommeRassenindentifikationsspezifizierunginstanztextaufzaehlbar()
} }
local Entry = {} local Entry = {}
@ -17,7 +17,7 @@ end
Entry.aktualisiereWerte = function(self:typeof(Entry), data:typeof(types.EntryData)):number Entry.aktualisiereWerte = function(self:typeof(Entry), data:typeof(types.EntryData)):number
local result = Utils.macheHypertexttransferprotokollAnfrage("eintrag", "PUT", "https://api.marcsync.dev/v0/entries/"..self._tableId, {["filters"]={["_id"]=self._objectId},["data"]=data}, self._accessToken); local result = Utils.macheHypertexttransferprotokollAnfrage("eintrag", "PUT", "https://api.marcsync.dev/v0/entries/"..self._tableId, {["filters"]={["_id"]=self._objectId},["data"]=data}, self._accessToken);
if result["success"] and result["modifiedEntries"] and result["modifiedEntries"] > 0 then if result["success"] and result["modifiedEntries"] and result["modifiedEntries"] > 0 then
for i,v in pairs(data) do for i,v in pairs(data) do
self._entryData[i] = v self._entryData[i] = v
@ -32,7 +32,7 @@ end
Entry.loesche = function(self:typeof(Entry)) Entry.loesche = function(self:typeof(Entry))
if typeof(self) ~= "table" then error("Bitte verwenden Sie : anstelle von .") end if typeof(self) ~= "table" then error("Bitte verwenden Sie : anstelle von .") end
local result = Utils.macheHypertexttransferprotokollAnfrage("eintrag", "DELETE", "https://api.marcsync.dev/v0/entries/"..self._tableId, {["filters"]={["_id"]=self._objectId}}, self._accessToken); local result = Utils.macheHypertexttransferprotokollAnfrage("eintrag", "DELETE", "https://api.marcsync.dev/v0/entries/"..self._tableId, {["filters"]={["_id"]=self._objectId}}, self._accessToken);
if not result["success"] then error(result["errorMessage"]) end if not result["success"] then error(result["errorMessage"]) end
self = nil self = nil