Skip to content

Commit 3522dd0

Browse files
committed
πŸ€ΎπŸ»β€β™€οΈπŸͺ™ ↝ You can now add the mineral deposit to your inventory
1 parent 0528d71 commit 3522dd0

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

β€Žcomponents/Content/Planets/Base/BasePlanetSector.tsx

+13-13
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,30 @@ const AddResourceToInventory = ({ resource }) => {
1919
setIsAdding(true);
2020
try {
2121
// Check if the user already has this resource in their inventory
22-
const { data: existingResource, error } = await supabase
23-
.from('inventoryUSERS')
24-
.select('*')
25-
.eq('owner', session?.user?.id)
26-
.eq('item', resource.id)
27-
.single();
22+
// const { data: existingResource, error } = await supabase
23+
// .from('inventoryUSERS')
24+
// .select('*')
25+
// .eq('owner', session?.user?.id)
26+
// .eq('item', resource)
27+
// .single();
2828

29-
if (error) {
30-
throw error;
31-
}
29+
// if (error) {
30+
// throw error;
31+
// }
3232

3333
let quantity = 1;
3434

3535
// If the user already has this resource, increment the quantity
36-
if (existingResource) {
37-
quantity = existingResource.quantity + 1;
38-
}
36+
// if (existingResource) {
37+
// quantity = existingResource.quantity + 1;
38+
// }
3939

4040
// Add the resource to the user's inventory
4141
const { error: insertError } = await supabase
4242
.from('inventoryUSERS')
4343
.upsert({
4444
owner: session?.user?.id,
45-
item: resource.id,
45+
item: resource,//.id,
4646
quantity,
4747
});
4848

0 commit comments

Comments
Β (0)