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

fetch projects

parent 2cc04eec
......@@ -75,9 +75,19 @@
</mat-step>
<mat-step [stepControl]="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>
<input matInput placeholder="Address" formControlName="secondCtrl" required>
<input matInput placeholder="Address" formControlName="thirdCtrl" required>
</mat-form-field>
<div>
<button mat-button matStepperPrevious>Back</button>
......
......@@ -10,9 +10,11 @@ import {FormBuilder, FormGroup} from '@angular/forms';
export class ProfileComponent implements OnInit {
firstFormGroup: FormGroup;
secondFormGroup: FormGroup;
thirdFormGroup: FormGroup;
constructor(private cookieService: CookieService,private _formBuilder: FormBuilder) {
this.firstFormGroup = this._formBuilder.group({firstCtrl: ['']});
this.secondFormGroup = this._formBuilder.group({secondCtrl: ['']});
this.thirdFormGroup = this._formBuilder.group({thirdCtrl: ['']});
}
ngOnInit(): void {
......
......@@ -14,5 +14,6 @@ urlpatterns = [
path('isAuthenticated/',checkAuthViewSet.as_view()),
path('authenticate/',authenticateViewSet.as_view()),
path('register/',registerViewSet.as_view()),
path('getRepos/',getReposViewSet.as_view()),
path('api-auth/',include('rest_framework.urls'))
]
......@@ -59,7 +59,13 @@ class getReposViewSet(views.APIView):
user = Users.objects.get(uid=uid)
if user is None:
return Response({'status':False})
repos = Projects.objects.filter(uid=user)
return Response({'repos':repos,'status':True})
access = Access.objects.filter(uid=user).values('pid').distinct()
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:
return Response({'status':False})
\ No newline at end of file
return Response({'status':False})
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