Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
webdevcody committed Feb 8, 2024
1 parent 5628e6d commit 13003c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
15 changes: 1 addition & 14 deletions convex/users.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
import { ConvexError, v } from "convex/values";
import {
MutationCtx,
QueryCtx,
internalMutation,
internalQuery,
query,
} from "./_generated/server";
import { internalMutation, internalQuery, query } from "./_generated/server";
import { authMutation, authQuery } from "./util";

const FREE_CREDITS = 5;

export const getUser = authQuery({
args: {},
handler: async (ctx, args) => {
return ctx.user;
},
});

export const getUserById = internalQuery({
args: { userId: v.string() },
handler: async (ctx, args) => {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useIsSubscribed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { useQuery } from "convex/react";
import { api } from "../../convex/_generated/api";

export function useIsSubscribed() {
const user = useQuery(api.users.getUser);
const user = useQuery(api.users.getMyUser);
return user && (user.endsOn ?? 0) > Date.now();
}

0 comments on commit 13003c8

Please sign in to comment.