Commit cf0eb5fe authored by Meet Narendra's avatar Meet Narendra 💬

fetch projects

parent 4cbcc81d
...@@ -75,9 +75,19 @@ ...@@ -75,9 +75,19 @@
</mat-step> </mat-step>
<mat-step [stepControl]="secondFormGroup"> <mat-step [stepControl]="secondFormGroup">
<form [formGroup]="secondFormGroup"> <form [formGroup]="secondFormGroup">
<ng-template matStepLabel>Fill out your address</ng-template> <ng-template matStepLabel>Profile picture</ng-template>
<input type="file" class="file-upload" formControlName="secondCtrl" onchange="console.log(event.target.files)">
<div>
<button mat-button matStepperPrevious>Back</button>
<button mat-button matStepperNext>Next</button>
</div>
</form>
</mat-step>
<mat-step [stepControl]="thirdFormGroup">
<form [formGroup]="thirdFormGroup">
<ng-template matStepLabel>Bio</ng-template>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Address" formControlName="secondCtrl" required> <input matInput placeholder="Address" formControlName="thirdCtrl" required>
</mat-form-field> </mat-form-field>
<div> <div>
<button mat-button matStepperPrevious>Back</button> <button mat-button matStepperPrevious>Back</button>
......
...@@ -10,9 +10,11 @@ import {FormBuilder, FormGroup} from '@angular/forms'; ...@@ -10,9 +10,11 @@ import {FormBuilder, FormGroup} from '@angular/forms';
export class ProfileComponent implements OnInit { export class ProfileComponent implements OnInit {
firstFormGroup: FormGroup; firstFormGroup: FormGroup;
secondFormGroup: FormGroup; secondFormGroup: FormGroup;
thirdFormGroup: FormGroup;
constructor(private cookieService: CookieService,private _formBuilder: FormBuilder) { constructor(private cookieService: CookieService,private _formBuilder: FormBuilder) {
this.firstFormGroup = this._formBuilder.group({firstCtrl: ['']}); this.firstFormGroup = this._formBuilder.group({firstCtrl: ['']});
this.secondFormGroup = this._formBuilder.group({secondCtrl: ['']}); this.secondFormGroup = this._formBuilder.group({secondCtrl: ['']});
this.thirdFormGroup = this._formBuilder.group({thirdCtrl: ['']});
} }
ngOnInit(): void { ngOnInit(): void {
......
...@@ -14,5 +14,6 @@ urlpatterns = [ ...@@ -14,5 +14,6 @@ urlpatterns = [
path('isAuthenticated/',checkAuthViewSet.as_view()), path('isAuthenticated/',checkAuthViewSet.as_view()),
path('authenticate/',authenticateViewSet.as_view()), path('authenticate/',authenticateViewSet.as_view()),
path('register/',registerViewSet.as_view()), path('register/',registerViewSet.as_view()),
path('getRepos/',getReposViewSet.as_view()),
path('api-auth/',include('rest_framework.urls')) path('api-auth/',include('rest_framework.urls'))
] ]
...@@ -59,7 +59,13 @@ class getReposViewSet(views.APIView): ...@@ -59,7 +59,13 @@ class getReposViewSet(views.APIView):
user = Users.objects.get(uid=uid) user = Users.objects.get(uid=uid)
if user is None: if user is None:
return Response({'status':False}) return Response({'status':False})
repos = Projects.objects.filter(uid=user) access = Access.objects.filter(uid=user).values('pid').distinct()
return Response({'repos':repos,'status':True}) try:
repos = Projects.objects.filter(pid__in=access)
print("Projects",Projects.objects.values())
except Exception as e:
print(e)
print("Repos",repos)
return Response({'repos':repos.values(),'status':True})
except: except:
return Response({'status':False}) return Response({'status':False})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment