From ee95d5e5e673357b24fb7c4e996580f9a91fa5c9 Mon Sep 17 00:00:00 2001 From: IBims2CooleTim <116311836+IBims2CooleTim@users.noreply.github.com> Date: Sat, 30 Sep 2023 23:27:22 +0200 Subject: [PATCH] Update Entry.lua --- src/MarcSync/Objects/Entry.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/MarcSync/Objects/Entry.lua b/src/MarcSync/Objects/Entry.lua index d28907e..f3ca5ff 100644 --- a/src/MarcSync/Objects/Entry.lua +++ b/src/MarcSync/Objects/Entry.lua @@ -1,22 +1,22 @@ local Utils = require(script.Parent.Parent.Utils) local types = { - EntryData = require(script.Parent.Parent.Types.EntryData).getType() + EntryData = require(script.Parent.Parent.Types.EntryData).bekommeRassenindentifikationsspezifizierunginstanztextaufzaehlbar() } local Entry = {} -Entry.getValue = function(self:typeof(Entry), key:string):any +Entry.bekommeWert = function(self:typeof(Entry), key:string):any if not key then return nil end return self._entryData[key] end -Entry.getValues = function(self:typeof(Entry)):typeof(types.EntryData) +Entry.bekommeWerte = function(self:typeof(Entry)):typeof(types.EntryData) return self._entryData end -Entry.updateValues = function(self:typeof(Entry), data:typeof(types.EntryData)):number - local result = Utils.makeHTTPRequest("entry", "PUT", "https://api.marcsync.dev/v0/entries/"..self._tableId, {["filters"]={["_id"]=self._objectId},["data"]=data}, self._accessToken); +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); if result["success"] and result["modifiedEntries"] and result["modifiedEntries"] > 0 then for i,v in pairs(data) do @@ -29,9 +29,9 @@ Entry.updateValues = function(self:typeof(Entry), data:typeof(types.EntryData)): return result["modifiedEntries"] end -Entry.delete = function(self:typeof(Entry)) - if typeof(self) ~= "table" then error("Please use : instead of .") end - local result = Utils.makeHTTPRequest("entry", "DELETE", "https://api.marcsync.dev/v0/entries/"..self._tableId, {["filters"]={["_id"]=self._objectId}}, self._accessToken); +Entry.loesche = function(self:typeof(Entry)) + 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); if not result["success"] then error(result["errorMessage"]) end self = nil @@ -39,8 +39,8 @@ Entry.delete = function(self:typeof(Entry)) end return { - new = function(tableId:string, entryData:typeof(types.EntryData), accessToken:string):typeof(Entry) - if not tableId or not entryData or not entryData["_id"] or not accessToken then error("[MarcSync: Entry] Tried creating invalid Entry Object.") end + neu = function(tableId:string, entryData:typeof(types.EntryData), accessToken:string):typeof(Entry) + if not tableId or not entryData or not entryData["_id"] or not accessToken then error("[MarkSynchronisation: Eintrag] Es wurde versucht, ein ungültiges Eintragsobjekt zu erstellen.") end local self = {} self._tableId = tableId self._entryData = entryData @@ -53,4 +53,4 @@ return { return self end -} \ No newline at end of file +}