https://supabase.com/ logo
Join DiscordCommunities
Powered by
# javascript
  • s

    silentworks

    01/22/2022, 5:20 PM
    SvelteKit with Supabase
  • f

    fanclubfm

    01/22/2022, 5:44 PM
    Any idea when will supabase-js use gotrue-js 1.22.0 ? I could really use auth.api.updateUserById asap 🙂 in the meantime I am making my own PUT request to
    ${url}/auth/v1/admin/users/${uid}
    with service key and it works.
  • z

    ziad

    01/23/2022, 12:59 AM
    Hey friends, I just finished writing my first tutorial on using Supabase + TypeScript. I hope it helps you write more robust applications with Supabase! https://www.fullstack-consultant.com/blog/using-supabase-with-typescript
  • d

    dohman

    01/23/2022, 8:26 AM
    Not directly related to Supabase, but would appreciate some help. I've made a small 'dashboard' to approve/reject entries. Logic
    Copy code
    js
    verifyEntry: async function(item) {
        const customersRequest = await supabase.from('customers').select('customer_email_address, license_active')
        let index = this.items.indexOf(item);
        this.items[index].isVerified = true;
            if (customersRequest.error) throw customersRequest.error
            for (const supabaseCustomer of customersRequest.data) {
              if (supabaseCustomer.license_active == true) {
                await this.sendEmailForm(item, supabaseCustomer.customer_email_address);
               }
            }
            const approveEntry = await supabase
                  .from('submissions')
                  .update({ isVerified: true })
                  .eq('id', item.id)
                  if (approveEntry.error) throw approveEntry.error;
      },
    UI
    Copy code
    html
    <tr v-for="item in items" :key="item.id">
                <td :class="item.isVerified == true ? 'bg-gray-500' : ''" v-for="entry in Object.values(item)" :key="entry">{{entry}}</td>
                <td>
    The issue I have is that, no matter which entry I 'approve', only the first one from the db changes to bg-gray-500 (and to isVerified == true). Once I do that, all other entries that I try to 'approve', nothing happens.
  • f

    Frus

    01/23/2022, 10:28 AM
    hello there! I was working on supabase nextjs todo list example on github and I noticed that you didn't fetch the data with getStaticProps. I'm not an expert but I thought getStaticProps should be used. I also watched john meyers course and he used getStaticProps for data fetching. I wonder if I'm missing anything or both are correct usage thanks in advance
  • p

    paxi

    01/23/2022, 2:06 PM
    Getting
    Copy code
    Unhandled Runtime Error
    SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
    error on supabase.auth.signUp({})
  • p

    paxi

    01/23/2022, 2:06 PM
    Can't seem to figure out where it's coming from
  • p

    paxi

    01/23/2022, 2:07 PM
    Any help please?
  • p

    PH4NTOMiki

    01/23/2022, 4:44 PM
    Hi, how to use , (comma) in a filter value in the .or() function because it uses comma to separate multiple filters? thanks
  • g

    garyaustin

    01/23/2022, 4:56 PM
    I answered in help. The mods really dislike double posting...
  • p

    PH4NTOMiki

    01/23/2022, 5:01 PM
    sorry, new in the channel
  • p

    PH4NTOMiki

    01/23/2022, 5:01 PM
    thx for answer
  • m

    Mattyfaz

    01/24/2022, 3:02 AM
    Is there a sum() function for Supabase? E.g. trying to replicate something like the following:
    Copy code
    SELECT SUM (amount) AS total
    FROM payment
    z
    • 2
    • 2
  • z

    ziad

    01/24/2022, 3:58 AM
    Custom queries with Supabase Client
  • f

    fanclubfm

    01/24/2022, 6:51 PM
    Glad to see todays update 🙂 Thanks
  • s

    Sealion

    01/24/2022, 8:34 PM
    Whats the purpose of "data: blog_post"? Can't I just do let = { data, error } ?
  • e

    Ekky

    01/24/2022, 8:44 PM
    You can, what you are looking at just reassigns the variable to blog_post.
  • s

    Sealion

    01/24/2022, 8:49 PM
    Yeah, it nothing more than that, cool. Though if it had something to do with postgres/supabase or soemthing but then I know
  • s

    silentworks

    01/24/2022, 8:49 PM
    Please create a thread
  • s

    Sealion

    01/24/2022, 8:49 PM
    Oh, sorry
  • s

    silentworks

    01/24/2022, 8:49 PM
    No problem, It's just easier to follow that way
  • s

    Sealion

    01/24/2022, 8:49 PM
    👍
  • m

    malaleche

    01/25/2022, 10:03 AM
    Hi, looks like supabase works smooth with Svelte, React, Vue... (SPAs) but when you want to use SSR (Sveltekit, Next, Nuxt) [i'm using sveltekit] the issue is kind of similar... to work with authentication... in the server side is not initiated the supabaseClient so you can't check if it's authenticated, neither can do SSR because you don't have the token of the user... any help? I've been reading for hours online and I don't see a nice way to go...
    s
    • 2
    • 55
  • f

    flv

    01/25/2022, 10:31 AM
    Same issue here, but with Next.js instead of SvelteKit
  • m

    malaleche

    01/25/2022, 10:34 AM
    I think you have to do some tricks such as: adding the token in the cookie, so that way it can be accessed by the hooks so it can add it to session so it can be accessed by load where you can create another client with that token and do the query... such a workaround but it's so far what I've red
  • m

    malaleche

    01/25/2022, 10:34 AM
    read
  • s

    silentworks

    01/25/2022, 11:23 AM
    SSR with Supabase
  • s

    stelofo

    01/25/2022, 3:05 PM
    Any idea how I can acces the image URLs in Storage? I tried this but obvs didn't work` `
  • s

    stelofo

    01/25/2022, 3:14 PM
    I'm getting the filename, but wondering how I can get the part of the URL that goes in front from Supabase
  • s

    stelofo

    01/25/2022, 3:17 PM
    the policies for Avatars is they're available publicly but when I go to the direct image url i get a
    Copy code
    {
    statusCode: "400", error: "Bad Request", message: "querystring should have required property 'token'" }
1...444546...81Latest