Skip to content

Commit

Permalink
Remove nick from user model
Browse files Browse the repository at this point in the history
Co-Authored-By: gf-rog <59065304+gf-rog@users.noreply.github.com>
Piterson25 and gf-rog committed Nov 23, 2023
1 parent cef68f7 commit 8cab9cf
Showing 6 changed files with 4 additions and 23 deletions.
7 changes: 0 additions & 7 deletions backend/src/data/users.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const userData = [
{
"nick": "boejiden",
"password": "sleepyjoe",
"first_name": "Joe",
"last_name": "Biden",
@@ -12,7 +11,6 @@ const userData = [
"chats": [],
},
{
"nick": "adamos",
"password": "mysz888",
"first_name": "Adam",
"last_name": "Małysz",
@@ -24,7 +22,6 @@ const userData = [
"chats": [],
},
{
"nick": "budyn1989",
"password": "kaczorlove",
"first_name": "Andrew",
"last_name": "Duda",
@@ -36,7 +33,6 @@ const userData = [
"chats": [],
},
{
"nick": "mentosdestroyer4",
"password": "mmmcow",
"first_name": "Kuba",
"last_name": "Nowak",
@@ -48,7 +44,6 @@ const userData = [
"chats": [],
},
{
"nick": "elonmusk",
"password": "DogeToTheMOON",
"first_name": "Elon",
"last_name": "Musk",
@@ -60,7 +55,6 @@ const userData = [
"chats": [],
},
{
"nick": "nowayno3",
"password": "432525n",
"first_name": "Olivia",
"last_name": "Smith",
@@ -71,7 +65,6 @@ const userData = [
"chats": [],
},
{
"nick": "rEptiliAn69",
"password": "metaverse4ever",
"first_name": "Mark",
"last_name": "Zuckerberg",
1 change: 0 additions & 1 deletion backend/src/models/User.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Chat from "./Chat";

export default interface User {
nick: string;
password: string;
first_name: string;
last_name: string;
6 changes: 2 additions & 4 deletions backend/test/userEndpoints.test.ts
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ let userId: number;

test("Create user", async () => {
const userData = {
nick: "Tommy",
password: "12345",
first_name: "Tom",
last_name: "Hanks",
@@ -40,7 +39,6 @@ test("Fetch user by ID", async () => {

test("Update user by ID", async () => {
const userUpdateData = {
nick: "Tommy",
password: "54321",
first_name: "Tommy",
last_name: "Hanks",
@@ -82,7 +80,7 @@ test("Get user's friends", async () => {
expect(usersStatus).toBe("ok");

const zuck = usersResponseData.users.find(
(user: any) => user.nick == "rEptiliAn69",
(user: any) => user.mail == "goodboymark1@meta.com",
);
const zuckId = zuck.id;

@@ -119,7 +117,7 @@ test("Search users", async () => {
expect(usersStatus).toBe("ok");

const zuck = usersResponseData.users.find(
([user, _score]: any) => user.nick == "rEptiliAn69",
([user, _score]: any) => user.mail == "goodboymark1@meta.com",
);

expect(zuck).toBeDefined();
4 changes: 2 additions & 2 deletions frontend/src/components/LoginBox.tsx
Original file line number Diff line number Diff line change
@@ -36,11 +36,11 @@ function LoginBox() {
className=" medium:w-[25vw] flex flex-col gap-2 bg-my-dark p-10 px-20 rounded-xl"
id="login-box"
>
<div>Login:</div>
<div>E-mail:</div>
<input
type="text"
className="text-my-dark form-input"
placeholder="Login"
placeholder="E-mail"
onChange={(e) => setLogin(e.target.value)}
/>

8 changes: 0 additions & 8 deletions frontend/src/components/RegisterBox.tsx
Original file line number Diff line number Diff line change
@@ -75,14 +75,6 @@ function RegisterBox() {
placeholder="E-mail"
/>

<div>Login:</div>
<input
type="text"
className="text-my-dark form-input"
onChange={updateFormUser("nick")}
placeholder="Login"
/>

<div>Password:</div>
<input
type="password"
1 change: 0 additions & 1 deletion frontend/src/models/user.model.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
interface User {
id: number;
nick: string;
password: string;
first_name: string;
last_name: string;

0 comments on commit 8cab9cf

Please sign in to comment.