Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a new storage bucket named 'photos'.
Supabase
const { data, error } = await supabase.storage.[1]('photos');Attempts:
3 left
💡 Hint
Common Mistakes
Using deleteBucket instead of createBucket.
Using listBuckets which only lists existing buckets.
✗ Incorrect
The createBucket method is used to create a new storage bucket in Supabase.
2fill in blank
mediumComplete the code to make the new bucket public.
Supabase
const { data, error } = await supabase.storage.createBucket('photos', { [1]: true });Attempts:
3 left
💡 Hint
Common Mistakes
Using 'private' which restricts access.
Using 'readonly' which is not a valid option here.
✗ Incorrect
Setting public to true makes the bucket accessible publicly.
3fill in blank
hardFix the error in the code to list all storage buckets.
Supabase
const { data, error } = await supabase.storage.[1]();Attempts:
3 left
💡 Hint
Common Mistakes
Using createBucket which creates a bucket instead of listing.
Using getBucket which requires a bucket name.
✗ Incorrect
The listBuckets method returns all storage buckets.
4fill in blank
hardFill both blanks to delete a bucket named 'archive'.
Supabase
const { data, error } = await supabase.storage.[1]('[2]');Attempts:
3 left
💡 Hint
Common Mistakes
Using createBucket instead of deleteBucket.
Using the wrong bucket name.
✗ Incorrect
Use deleteBucket to remove a bucket. The bucket name here is 'archive'.
5fill in blank
hardFill all three blanks to update a bucket named 'documents' to be private.
Supabase
const { data, error } = await supabase.storage.[1]('[2]', { [3]: false });Attempts:
3 left
💡 Hint
Common Mistakes
Using createBucket instead of updateBucket.
Setting 'public' to true instead of false.
✗ Incorrect
The updateBucket method changes bucket settings. Setting public to false makes it private.
