Got it running with sentry and plausible and stuff. Auth seems good
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { v } from "convex/values";
|
||||
import { query, mutation, action } from "./_generated/server";
|
||||
import { api } from "./_generated/api";
|
||||
import { getAuthUserId } from "@convex-dev/auth/server";
|
||||
import { v } from 'convex/values';
|
||||
import { query, mutation, action } from './_generated/server';
|
||||
import { api } from './_generated/api';
|
||||
import { getAuthUserId } from '@convex-dev/auth/server';
|
||||
|
||||
// Write your Convex functions in any file inside this directory (`convex`).
|
||||
// See https://docs.convex.dev/functions for more.
|
||||
@@ -18,9 +18,9 @@ export const listNumbers = query({
|
||||
//// Read the database as many times as you need here.
|
||||
//// See https://docs.convex.dev/database/reading-data.
|
||||
const numbers = await ctx.db
|
||||
.query("numbers")
|
||||
.query('numbers')
|
||||
// Ordered by _creationTime, return most recent
|
||||
.order("desc")
|
||||
.order('desc')
|
||||
.take(args.count);
|
||||
const userId = await getAuthUserId(ctx);
|
||||
const user = userId === null ? null : await ctx.db.get(userId);
|
||||
@@ -44,9 +44,9 @@ export const addNumber = mutation({
|
||||
//// Mutations can also read from the database like queries.
|
||||
//// See https://docs.convex.dev/database/writing-data.
|
||||
|
||||
const id = await ctx.db.insert("numbers", { value: args.value });
|
||||
const id = await ctx.db.insert('numbers', { value: args.value });
|
||||
|
||||
console.log("Added new document with id:", id);
|
||||
console.log('Added new document with id:', id);
|
||||
// Optionally, return a value from your mutation.
|
||||
// return id;
|
||||
},
|
||||
|
Reference in New Issue
Block a user