Skip to content

Commit

Permalink
deleting all prints
Browse files Browse the repository at this point in the history
  • Loading branch information
Osmait committed Nov 9, 2023
1 parent 95c03a7 commit 53c81e4
Show file tree
Hide file tree
Showing 24 changed files with 54 additions and 244 deletions.
1 change: 0 additions & 1 deletion CommentServices/main.py
Expand Up @@ -62,7 +62,6 @@ async def get_current_id(

@app.get("/comment/{id}")
async def getComment(id: str, current_user: Annotated[str, Security(get_current_id, scopes=["me"])]):
print(current_user)
comments = comment_service.find_all_by_id(id)
return comments

Expand Down
21 changes: 0 additions & 21 deletions FrontendRedSocial/red-social/LICENSE

This file was deleted.

4 changes: 2 additions & 2 deletions FrontendRedSocial/red-social/README.md
Expand Up @@ -14,7 +14,6 @@ This is a template for creating applications using Next.js 13 (app directory) an

## How to Use


### Use the template with create-next-app

To create a new project based on this template using `create-next-app`, run the following command:
Expand All @@ -37,4 +36,5 @@ npm run dev

## License

Licensed under the [MIT license](https://github.com/nextui-org/next-app-template/blob/main/LICENSE).
Licensed under the [MIT license](https://github.com/nextui-org/next-app-template/blob/main/LICENSE).

6 changes: 2 additions & 4 deletions FrontendRedSocial/red-social/app/components/Notification.tsx
Expand Up @@ -5,15 +5,14 @@ import Link from "next/link";
import React, { useEffect } from "react";
import { useNotification } from "../store/state";


export const Notification = () => {
const notifications = useNotification((state) => state.messages);
const setMessage = useNotification((state) => state.setMessages);
const notificationLen = useNotification((state) => state.notificationLen);
const setNotificationLen = useNotification(
(state) => state.setNotificationLen
(state) => state.setNotificationLen,
);
const user = useNotification(state => state.user)
const user = useNotification((state) => state.user);

const reset = useNotification((state) => state.reset);

Expand All @@ -25,7 +24,6 @@ export const Notification = () => {

newSocket.onmessage = (event) => {
const ms = JSON.parse(event.data);
console.log(event.data);
setMessage(ms);
};

Expand Down
10 changes: 2 additions & 8 deletions FrontendRedSocial/red-social/app/components/UnFollowButton.tsx
Expand Up @@ -8,20 +8,14 @@ type Props = {
followRequest: followRequest;
isFollow: boolean;
setFollow: (b: boolean) => void;

};

export const UnFollowButton = ({
followRequest,
setFollow,
}: Props) => {
export const UnFollowButton = ({ followRequest, setFollow }: Props) => {
const token = Cookies.get("x-token");
if (!token) {
throw new Error("Error Token Dont exist ")
throw new Error("Error Token Dont exist ");
}


console.log(followRequest);
const handlerFollow = async () => {
await unFollow(followRequest, token);
setFollow(false);
Expand Down
1 change: 0 additions & 1 deletion FrontendRedSocial/red-social/app/services/AuthService.ts
Expand Up @@ -11,7 +11,6 @@ export async function loginService(loginRequest: any) {

try {
const response = await fetch("http://localhost:8001/login", options);
console.log(response.status);
const token = await response.json();
Cookies.set("x-token", token.token);
} catch (error) {
Expand Down
18 changes: 8 additions & 10 deletions FrontendRedSocial/red-social/app/services/post.services.ts
@@ -1,10 +1,7 @@
import { cookies } from "next/headers";
import { CommentRequest, PostRequest, PostResponse } from "../../types";



export async function findMyProfilePost(
token: string
token: string,
): Promise<PostResponse[]> {
const options: any = {
cache: "no-cache",
Expand All @@ -14,15 +11,15 @@ export async function findMyProfilePost(
},
};

const response = await fetch('http://127.0.0.1:5000/api/post', options);
const response = await fetch("http://127.0.0.1:5000/api/post", options);
const result = await response.json();

return result;
}

export async function findPost(
id: string,
token: string
token: string,
): Promise<PostResponse[]> {
const options: any = {
cache: "no-cache",
Expand All @@ -43,16 +40,17 @@ export async function findProfilePost(
token: string,
page: number,
): Promise<PostResponse[]> {
console.log(id);
const options: any = {
cache: "no-cache",
headers: {
"Content-Type": "application/json", // Especificamos que estamos enviando datos JSON
Authorization: `Bearer ${token}`,
},
};
console.log(page)
const response = await fetch(`http://127.0.0.1:5000/api/feed/${id}?page=${page}&limit=10`, options);
const response = await fetch(
`http://127.0.0.1:5000/api/feed/${id}?page=${page}&limit=10`,
options,
);

const result = await response.json();

Expand Down Expand Up @@ -95,7 +93,7 @@ export async function createComment(post: CommentRequest, token: string) {
}
export async function findOnePost(
id: string,
token: string
token: string,
): Promise<PostResponse> {
const options: any = {
cache: "no-cache",
Expand Down
3 changes: 1 addition & 2 deletions PostServices/post-service/docker-compose.yaml
Expand Up @@ -16,7 +16,7 @@ services:
build:
context: .
dockerfile: Dockerfile

ports:
- 3000:3000
depends_on:
Expand All @@ -25,4 +25,3 @@ services:
# - .:/app
# - "/app/node_modules"
command: npm run start:dev

4 changes: 1 addition & 3 deletions PostServices/post-service/src/app.controller.ts
Expand Up @@ -3,9 +3,7 @@ import { AppService } from './app.service';

@Controller()
export class AppController {
constructor(
private readonly appService: AppService
) { }
constructor(private readonly appService: AppService) {}

@Get()
getHello(): string {
Expand Down
Expand Up @@ -29,11 +29,7 @@ export class PostController {
@Query('comment') comment: string,
@Req() request: Request,
) {
console.log(comment);
const token = request.headers['token'];
const userId = request.headers['user'];
console.log(token);
console.log(userId);
if (!token) {
throw new UnauthorizedException();
}
Expand Down
Expand Up @@ -155,7 +155,7 @@ describe('PostService', () => {
config: undefined,
},
isAxiosError: false,
toJSON: function(): object {
toJSON: function (): object {
throw new Error('Function not implemented.');
},
};
Expand Down
1 change: 0 additions & 1 deletion PostServices/post-service/src/post/service/post.service.ts
Expand Up @@ -30,7 +30,6 @@ export class PostService {

created(post: Post) {
post.id = randomUUID();
console.log(post);

try {
this.postRepository.save(post);
Expand Down
1 change: 0 additions & 1 deletion apiGateway/internals/platform/server/handlers/handlers.go
Expand Up @@ -42,7 +42,6 @@ func GetProfile(c config.Config) gin.HandlerFunc {
ctx.Status(http.StatusInternalServerError)
return
}
fmt.Println("aquiii")

ctx.JSON(http.StatusOK, user)
}
Expand Down
2 changes: 0 additions & 2 deletions apiGateway/internals/platform/utils/jwtDecode.go
@@ -1,7 +1,6 @@
package utils

import (
"fmt"
"strings"

"github.com/gin-gonic/gin"
Expand All @@ -16,7 +15,6 @@ type AppClaims struct {
func DecodeJwt(c *gin.Context) (*jwt.Token, error) {
tokeString := strings.TrimSpace(c.GetHeader("Authorization"))
tokenClen := strings.Split(" ", tokeString)
fmt.Println(tokenClen)
token, err := jwt.ParseWithClaims(tokenClen[1], AppClaims{}, func(token *jwt.Token) (interface{}, error) {
return []byte("secret"), nil
})
Expand Down
Expand Up @@ -8,7 +8,6 @@ export class FollowerController {

@Post('follower/')
public createdfollower(@Body() follower: Follower) {
console.log(follower);
this.followerService.follow(follower);
}

Expand Down
2 changes: 1 addition & 1 deletion notificationService/index.html
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
126 changes: 0 additions & 126 deletions notificationService/internas/platform/server/handlers/handler.go

This file was deleted.

3 changes: 0 additions & 3 deletions notificationService/internas/platform/server/server.go
Expand Up @@ -39,10 +39,7 @@ func New(ctx context.Context, host string, port uint, shutdownTimeout time.Durat

func (s *Server) registerRoutes() {
s.Engine.Use(cors.AllowAll())
// s.Engine.Use(middleware.CheckAuthMiddleware())

// s.Engine.GET("/ws/:id", handlers.Notification(s.notificationService))
// s.Engine.GET("/ws/:id", s.Hub.HandleWebSocket(s.notificationService))
s.Engine.GET("/ws/:id", websocket.HandlerWs(s.Hub, s.notificationService))
}

Expand Down

0 comments on commit 53c81e4

Please sign in to comment.