Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
fix: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
KunalSin9h committed May 28, 2024
1 parent 59b07e3 commit 111b242
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 4 deletions.
1 change: 1 addition & 0 deletions drizzle/0004_sour_dazzler.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "links" ALTER COLUMN "user_name" DROP DEFAULT;
225 changes: 225 additions & 0 deletions drizzle/meta/0004_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
{
"id": "3c47963d-4dee-4d96-9ba2-0d56e589d5d3",
"prevId": "a7517c57-dfc2-4ebd-92f0-40e145372409",
"version": "6",
"dialect": "postgresql",
"tables": {
"public.links": {
"name": "links",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true
},
"url": {
"name": "url",
"type": "text",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"host": {
"name": "host",
"type": "varchar(325)",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"user_name": {
"name": "user_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"views": {
"name": "views",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"votes": {
"name": "votes",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"links_user_id_users_id_fk": {
"name": "links_user_id_users_id_fk",
"tableFrom": "links",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"public.user_upvote_link": {
"name": "user_upvote_link",
"schema": "",
"columns": {
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"link_id": {
"name": "link_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"user_upvote_link_user_id_users_id_fk": {
"name": "user_upvote_link_user_id_users_id_fk",
"tableFrom": "user_upvote_link",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"user_upvote_link_link_id_links_id_fk": {
"name": "user_upvote_link_link_id_links_id_fk",
"tableFrom": "user_upvote_link",
"tableTo": "links",
"columnsFrom": [
"link_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"public.users": {
"name": "users",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true
},
"frist_name": {
"name": "frist_name",
"type": "varchar(256)",
"primaryKey": false,
"notNull": true
},
"last_name": {
"name": "last_name",
"type": "varchar(256)",
"primaryKey": false,
"notNull": false
},
"email": {
"name": "email",
"type": "varchar(256)",
"primaryKey": false,
"notNull": true
},
"image": {
"name": "image",
"type": "varchar(256)",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
}
},
"indexes": {
"email_index": {
"name": "email_index",
"columns": [
"email"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {
"public.categories": {
"name": "categories",
"schema": "public",
"values": [
"manufacturing",
"research"
]
}
},
"schemas": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
7 changes: 7 additions & 0 deletions drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
"when": 1716894631934,
"tag": "0003_massive_hydra",
"breakpoints": true
},
{
"idx": 4,
"version": "6",
"when": 1716897330232,
"tag": "0004_sour_dazzler",
"breakpoints": true
}
]
}
3 changes: 2 additions & 1 deletion src/components/LinkBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ export default function LinkBox({
</div>
<button
class={`group flex flex-col items-center justify-center cursor-pointer text-sm ${
upVote() === undefined && "disable invisible"
upVote() === undefined &&
"pointer-events-none opacity-60 cursor-not-allowed"
}`}
onClick={async () => {
if (!currentUser()) return;
Expand Down
4 changes: 3 additions & 1 deletion src/components/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export default function UserProfile({ user }: { user: UserType }) {
class="w-full mx-auto my-1 flex items-center gap-2 text-md justify-center hover:underline underline-offset-4"
onClick={() => {
setClicked(true);
logout() && window.location.reload();
logout();
window.location.reload();
window.location.reload();
}}
>
<Show when={clicked()} fallback={<p>Logout</p>}>
Expand Down
2 changes: 0 additions & 2 deletions src/server-function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ export function logout() {

deleteCookie(AUTH_TOKEN);
deleteCookie(AUTH_USER_DATA);

return true;
}

export const userData = async (userId: string) => {
Expand Down

0 comments on commit 111b242

Please sign in to comment.