Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HypheX authored Feb 7, 2019
1 parent f4b38bd commit f367a02
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Trello/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ local Constructors = script.Parent.Constructors
local ConList = {
Board = require(Constructors.Board),
List = require(Constructors.List),
Card = require(Constructors.Card)
Card = require(Constructors.Card),
Label = require(Constructors.Label)
}

script.Parent.auth:Destroy()

Trello.new = function(className, name, parent)
if ConList[className] then
if className == "Board" then
return (ConList.Board.new({name = name}, ConList["Board"], ConList["List"], ConList["Card"]))
return (ConList.Board.new({name = name}, ConList["Board"], ConList["List"], ConList["Card"], ConList["Label"]))
elseif className == "List" then
if parent then
if parent:ClassName() == "Board" then
return (ConList.List.new({name = name, idBoard = parent:GetId()}, ConList["Board"], ConList["List"], ConList["Card"]))
return (ConList.List.new({name = name, idBoard = parent:GetId()}, ConList["Board"], ConList["List"], ConList["Card"], ConList["Label"]))
else
error("List - argument #3 is not a board.", 0)
end
Expand All @@ -30,7 +31,7 @@ Trello.new = function(className, name, parent)
else
if parent then
if parent:ClassName() == "List" then
return (ConList.Card.new({name = name, idCard = parent:GetId()}, ConList["Board"], ConList["List"], ConList["Card"]))
return (ConList.Card.new({name = name, idCard = parent:GetId()}, ConList["Board"], ConList["List"], ConList["Card"], ConList["Label"]))
else
error("Card - argument #3 is not a card.", 0)
end
Expand All @@ -57,7 +58,7 @@ function Trello:GetBoardByName(name)
end
end
if fId then
return (ConList.Board.new({id = fId}, ConList["Board"], ConList["List"], ConList["Card"]))
return (ConList.Board.new({id = fId}, ConList["Board"], ConList["List"], ConList["Card"], ConList["Label"]))
else
return nil
end
Expand All @@ -74,7 +75,7 @@ function Trello:GetBoardById(id)
end)

if Ret then
return (ConList.Board.new({id = tostring(id)}, ConList["Board"], ConList["List"], ConList["Card"]))
return (ConList.Board.new({id = tostring(id)}, ConList["Board"], ConList["List"], ConList["Card"], ConList["Label"]))
end
end
end
Expand Down

0 comments on commit f367a02

Please sign in to comment.