Skip to content

Commit 657a5c8

Browse files
committed
changed ts to js
1 parent bd4c50e commit 657a5c8

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

pages/users/[userId].tsx renamed to pages/users/[userId].js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
import { GetServerSidePropsContext } from 'next';
21
import { useRouter } from 'next/router';
32
import React, { useEffect, useState } from 'react';
43
import Layout from '../../components/Layout';
5-
import { User } from '../../util/database';
64

7-
type Props = {
8-
user: User;
9-
notificationLength?: number;
10-
};
11-
12-
const SingleUser = (props: Props) => {
5+
const SingleUser = (props) => {
136
const router = useRouter();
147
const [notificationLength, setNotificationLength] = useState();
158

16-
const deleteUser = async (id: number) => {
9+
const deleteUser = async (id) => {
1710
await fetch(`/api/users/${id}`, {
1811
method: 'DELETE',
1912
headers: { 'Content-Type': 'application/json' },
@@ -25,6 +18,8 @@ const SingleUser = (props: Props) => {
2518
setNotificationLength(props.notificationLength);
2619
}, [props.notificationLength]);
2720

21+
console.log(notificationLength);
22+
2823
return (
2924
<Layout notificationLength={props.notificationLength}>
3025
<div className="max-w-7xl mx-auto p-4 md:p-10 text-center">
@@ -64,7 +59,7 @@ const SingleUser = (props: Props) => {
6459

6560
export default SingleUser;
6661

67-
export async function getServerSideProps(context: GetServerSidePropsContext) {
62+
export async function getServerSideProps(context) {
6863
const { getUser, getUserBySessionToken, getWantlistbyItemUserId } =
6964
await import('../../util/database');
7065

tsconfig.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
"$schema": "https://json.schemastore.org/tsconfig",
33
"display": "UpLeveled Node + React TSConfig",
44
"compilerOptions": {
5-
"lib": [
6-
"dom",
7-
"dom.iterable",
8-
"esnext"
9-
],
5+
"lib": ["dom", "dom.iterable", "esnext"],
106
"module": "esnext",
117
"target": "es2015",
128
"moduleResolution": "node",
@@ -32,10 +28,7 @@
3228
"**/*.js",
3329
"**/*.cjs",
3430
"**/*.mjs",
35-
"pages/users/[userId].tsx"
31+
"pages/users/[userId].js"
3632
],
37-
"exclude": [
38-
"node_modules",
39-
"build"
40-
]
33+
"exclude": ["node_modules", "build"]
4134
}

0 commit comments

Comments
 (0)