Skip to content

Commit

Permalink
removes auth packages
Browse files Browse the repository at this point in the history
  • Loading branch information
wmalarski committed Sep 2, 2023
1 parent 4433d8c commit 9e1091c
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 113 deletions.
9 changes: 0 additions & 9 deletions drizzle.config.js

This file was deleted.

4 changes: 0 additions & 4 deletions drizzle.config.json

This file was deleted.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
"vite-plugin-solid": "^2.7.0"
},
"dependencies": {
"@auth/core": "^0.12.0",
"@auth/solid-start": "^0.1.1",
"@kobalte/core": "^0.11.0",
"@kobalte/tailwindcss": "^0.8.0",
"@notionhq/client": "2.2.12",
Expand Down
68 changes: 0 additions & 68 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/routes/dashboard/invoice/[invoiceId]/copy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const CopyInvoicePage: Component = () => {
invoice={invoice()}
breadcrumbs={[
{
path: paths.copyInvoice(invoice().id),
path: paths.copyInvoice(id()),
text: t("topbar.copyInvoice"),
},
]}
Expand Down
4 changes: 2 additions & 2 deletions src/routes/dashboard/invoice/[invoiceId]/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const EditInvoicePage: Component = () => {
invoice={invoice()}
breadcrumbs={[
{
path: paths.editInvoice(invoice().id),
path: paths.editInvoice(id()),
text: t("topbar.editInvoice"),
},
]}
Expand All @@ -76,7 +76,7 @@ const EditInvoicePage: Component = () => {
<div class="p-8 pt-0">
<InvoiceForm
error={getServerError(editMutation.error)}
id={invoice().id}
id={id()}
initial={invoice()}
isLoading={editMutation.isPending}
onSubmit={onSubmit}
Expand Down
7 changes: 6 additions & 1 deletion src/routes/dashboard/invoices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ const InvoicesPage: Component = () => {
const result = await selectInvoicesServerQuery(context.queryKey);

result.collection.results.forEach((invoice) => {
queryClient.setQueryData(selectInvoiceKey({ id: invoice.id }), invoice);
if (invoice.id) {
queryClient.setQueryData(
selectInvoiceKey({ id: invoice.id }),
invoice,
);
}
});

return result;
Expand Down
16 changes: 7 additions & 9 deletions src/server/invoices/actions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import server$, { useRequest } from "solid-start/server";
import * as v from "valibot";
import { getSessionOrThrow } from "../auth/session";
import {
createInvoice,
deleteInvoice,
Expand Down Expand Up @@ -34,7 +35,7 @@ export const selectInvoiceServerQuery = server$(
request: server$.request || requestEvent.request,
};

// const user = await getUser(event);
getSessionOrThrow(event);

return queryInvoice({
event,
Expand Down Expand Up @@ -73,11 +74,7 @@ export const selectInvoicesServerQuery = server$(
request: server$.request || requestEvent.request,
};

// const user = await getUser({
// env: server$.env || event.env,
// locals: server$.locals || event.locals,
// request: server$.request || event.request,
// });
getSessionOrThrow(event);

const [collection] = await Promise.all([
queryInvoices({
Expand Down Expand Up @@ -130,12 +127,11 @@ export const updateInvoiceServerMutation = server$(
async (data: v.Input<ReturnType<typeof updateInvoiceArgs>>) => {
const parsed = v.parse(updateInvoiceArgs(), data);

// const user = await getUser(server$);
getSessionOrThrow(server$);

await updateInvoice({
event: server$,
invoice: parsed,
// userId: user.id,
});

return parsed;
Expand All @@ -146,7 +142,7 @@ export const insertInvoiceServerMutation = server$(
async (data: v.Input<ReturnType<typeof invoiceSchema>>) => {
const parsed = v.parse(invoiceSchema(), data);

// const user = await getUser(server$);
getSessionOrThrow(server$);

const invoice = await createInvoice({ event: server$, invoice: parsed });

Expand All @@ -162,6 +158,8 @@ export const deleteInvoiceServerMutation = server$(
async (data: v.Input<ReturnType<typeof deleteSchemaArgs>>) => {
const parsed = v.parse(deleteSchemaArgs(), data);

getSessionOrThrow(server$);

await deleteInvoice({ event: server$, id: parsed.id });

return parsed.id;
Expand Down
13 changes: 0 additions & 13 deletions src/types/next-auth.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/types/solid-start-vercel.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { defineConfig } from "vite";
export default defineConfig(() => {
dotenv.config();
return {
plugins: [solid({ adapter: vercel() })],
plugins: [solid({ adapter: vercel({}) })],
ssr: { noExternal: ["@kobalte/core"] },
};
});

0 comments on commit 9e1091c

Please sign in to comment.