Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS migration #2

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from
Open

TS migration #2

wants to merge 15 commits into from

Conversation

d-leeee
Copy link
Collaborator

@d-leeee d-leeee commented Sep 23, 2024

had some issues with dev branch but should be good.

@d-leeee d-leeee self-assigned this Sep 23, 2024
@d-leeee d-leeee linked an issue Sep 23, 2024 that may be closed by this pull request

const { name, email }: User = await req.json();
try {
const db = client.db();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

db config should be made in the util file

@@ -1,5 +1,7 @@
"use client";

import React from "react";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont need react imports

@@ -1,6 +1,7 @@
/* eslint-disable new-cap */
import "./globals.css";
import { Inter } from "next/font/google";
import React from "react";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont need react imports

@@ -10,7 +11,11 @@ export const metadata = {
description: "MongoDB Setup Integration with Next.js",
};

export default function RootLayout({ children }) {
type Prop = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use interface

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be props

src/app/page.tsx Outdated
e.preventDefault();
api({
method: "POST",
url: "/api/user",
body: { name, email },
})
.then(() => toast(`Submitted successfully!`))
.then((res) => {
if (res.status >= 200 && res.status < 300) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

range checks dont work with http 😭 u can assume that if it goes thru its alr good

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh i never wrote that, i think that was an issue with dev branch

src/utils/api.ts Outdated
@@ -0,0 +1,25 @@
type apiGet = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use interfaces

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should just be request or Request

src/utils/api.ts Outdated
body: object;
};

type apiResponse = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should just be Response or response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TS Migration
3 participants