Skip to content

Commit 9fc665a

Browse files
author
vinidalvino
committed
Finished GetStoreInfo
I finsihed the function that tell us info about a specific. If I missed something about the info of a store please let me know in this pull comment. Thank you!
1 parent c1ffb0d commit 9fc665a

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ An library for ordering pizza from domino pizza on roblox
66
* [x] Figure out the endpoint
77
* [x] Write a library function
88
* Get info about a specific restaurant
9-
* [ ] Figure out the endpoint
10-
* [ ] Write a library function
9+
* [x] Figure out the endpoint
10+
* [x] Write a library function
1111
* Get the menu for a restaurant
1212
* [ ] Figure out the endpoint
1313
* [ ] Write a library function

src/ReplicatedStorage/DominoPizzaAPI/StoreLocator.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ function StoreLocator.StoreSearch(City,Province,PostalCode) -- Get all nearby st
1212
assert(Province,'Missing argument : Province missing')
1313
assert(PostalCode,'Missing argument : PostalCode missing')
1414
local url = DominoURL.URL.Canada.StoreLocator .. City .. '%20' .. Province .. '%20' .. PostalCode
15-
print(url)
1615
local Data = HttpService:JSONDecode((HttpService:GetAsync(url)))
1716
if Data.status == -104 then
1817
error('You did not entered the store information correctly. Check if you entred the Address corretcly',2)
@@ -25,10 +24,13 @@ function StoreLocator.GetStoreInfo(City,Province,PostalCode,StoreID)
2524
assert(Province,'Missing argument : Province missing')
2625
assert(PostalCode,'Missing argument : PostalCode missing')
2726
assert(StoreID,'Missing argument : StoreID missing')
28-
local StoreIDSearch = table.find(StoreLocator.StoreSearch(City,Province,PostalCode,StoreID)
29-
if StoreIDSearch == 1 then
30-
print('Found!' .. '\n' .. StoreIDSearch)
31-
end
27+
local StoreNearBy = StoreLocator.StoreSearch(City,Province,PostalCode)
28+
for i,v in pairs(StoreNearBy.Stores) do
29+
if v.StoreID == StoreID then
30+
return v
31+
end
32+
break
33+
end
3234
end
3335

3436
return StoreLocator

0 commit comments

Comments
 (0)