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

small connection errors @ disconnect #15

Merged
merged 1 commit into from
Nov 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
connection errors @ disconnect
  • Loading branch information
anto-pv committed Nov 13, 2021
commit e92dae39749abeb5e2b39412f101ab4d94c9982d
2 changes: 1 addition & 1 deletion src/profile/entities/profile.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default class Profile {
accomplishments: string[];

@OneToMany(() => Connections, (connection) => connection.connection_memberid,{nullable:true})
connections: Connections[];//We try to connect others
connections: Connections[];//Our connectinos

@OneToMany(() => Connections, (connection) => connection.member_id,{nullable:true})
secondaryconnections: Connections[];//Others who try to connect us
Expand Down
2 changes: 1 addition & 1 deletion src/profile/profile.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export class ProfileController {
Cancel(@Param() id: string, @Body() body: ConnectionDto) {
return this.profileService.connectioncancel(id, body.profile_id);
}

//add pid
@Post('/:id/connect')
@ApiOperation({ summary: 'Connect' })
@ApiParam({ name: 'id', required: true, schema: { oneOf: [{ type: 'string' }] } })
Expand Down
3 changes: 1 addition & 2 deletions src/profile/profile.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import Profile from './entities/profile.entity';
import Connections from './entities/connections.entity';
import Skills from './entities/skills.entity';
import Experience from './entities/experience.entity';
import Company from '../company/entities/company.entity';
import { Posts } from 'src/posts/entity/post.entity';
import { Comments } from 'src/comments/entities/comment.entity';
import User from 'src/user/entities/user.entity';

@Module({
imports:[ TypeOrmModule.forFeature([ Profile,Connections,Skills,Experience,Company,Posts,Comments,User ])],
imports:[ TypeOrmModule.forFeature([ Profile,Connections,Skills,Experience,Posts,Comments,User ])],
controllers: [ProfileController],
providers: [ProfileService]
})
Expand Down
6 changes: 3 additions & 3 deletions src/profile/profile.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ export class ProfileService {

if (user.id != current_User) {
try {
// console.log(user)
console.log(user)
// console.log(current_User)
var user_details = await this.profileRepository.findOne(user.id)
var current_User_details = await this.profileRepository.findOne(current_User)
Expand Down Expand Up @@ -453,8 +453,8 @@ export class ProfileService {
try {
var user_details = await this.profileRepository.findOne(user.id)
var current_User_details = await this.profileRepository.findOne(current_User)
await this.connectionRepository.createQueryBuilder().delete().where({ connected_profile: current_User_details, profile: user_details, status: "connected" }).execute()
await this.connectionRepository.createQueryBuilder().delete().where({ connected_profile: user_details, profile: current_User_details, status: "connected" }).execute()
var stu1=await this.connectionRepository.createQueryBuilder().delete().where({ member_id: current_User_details, connection_memberid: user_details, status: "connected" }).execute()
var stu2=await this.connectionRepository.createQueryBuilder().delete().where({ member_id: user_details, connection_memberid: current_User_details, status: "connected" }).execute()
return {
success: true,
message: 'Disconnected',
Expand Down