Commit f5cbecbf authored by Revant Nandgaonkar's avatar Revant Nandgaonkar

Fix Cloud Storage and Profile Avatar Upload

Merge branch 'fixes' into 'develop'

See merge request castlecraft/building-blocks!286
parents b13aba99 84fde9fc
......@@ -52,8 +52,7 @@ export class CloudStorageController {
}
@Get('v1/getOne/:uuid')
@Roles(ADMINISTRATOR)
@UseGuards(TokenGuard, RoleGuard)
@UseGuards(TokenGuard)
async findOne(@Param('uuid') uuid: string) {
const storage: Storage = await this.storage.findOne({ uuid });
storage.accessKey = undefined;
......@@ -92,7 +91,7 @@ export class CloudStorageController {
@Post('cloud/uploadFile/:uuid')
@UseInterceptors(FileInterceptor('file'))
async testing(
async uploadFile(
@UploadedFile('file') file,
@Req() req,
@Body('permission') permission,
......
......@@ -6,6 +6,7 @@ import { FormsModule } from '@angular/forms';
import { AuthService } from '../auth/auth.service';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { RouterTestingModule } from '@angular/router/testing';
describe('SignupComponent', () => {
let fixture: ComponentFixture<SignupComponent>;
......@@ -26,6 +27,7 @@ describe('SignupComponent', () => {
FormsModule,
BrowserAnimationsModule,
HttpClientTestingModule,
RouterTestingModule,
],
}).compileComponents();
}));
......
......@@ -4,6 +4,8 @@ import { MatSnackBar } from '@angular/material';
import { SOMETHING_WENT_WRONG } from '../../constants/messages';
import { SignupService } from './signup.service';
import { ServerInfo } from '../../common/server-info.interface';
import { CLOSE, PLEASE_CHECK_EMAIL } from 'src/constants/app-strings';
import { Router } from '@angular/router';
@Component({
selector: 'app-signup',
......@@ -21,6 +23,7 @@ export class SignupComponent implements OnInit {
private authService: AuthService,
private snackBar: MatSnackBar,
private signupService: SignupService,
private router: Router,
) {}
ngOnInit() {
......@@ -44,11 +47,12 @@ export class SignupComponent implements OnInit {
)
.subscribe({
next: (response: any) => {
window.location.href = '/login';
this.snackBar.open(PLEASE_CHECK_EMAIL, CLOSE, { duration: 5000 });
this.router.navigateByUrl('/login');
},
error: err => {
if (typeof err.error.message === 'string') {
this.snackBar.open(err.error.message, null, { duration: 2500 });
this.snackBar.open(err.error.message, null, { duration: 5000 });
} else {
this.snackBar.open(SOMETHING_WENT_WRONG);
}
......
export const APP_ID = 'authorization-server';
export const CLOSE = 'close';
export const PLEASE_CHECK_EMAIL = 'Please check email to reset password';
export const PLEASE_CHECK_EMAIL = 'Please check your email';
export const PLEASE_CHECK_USERNAME =
'Something went wrong, Please re-check username';
export const AVAILABLE_TRANSLATIONS = [
......
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