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

signup/login fix by removing username as req #77

Merged
merged 2 commits into from
Sep 22, 2024
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
32 changes: 10 additions & 22 deletions api/src/controllers/register.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@ export class RegisterController {
'application/json': {
schema: {
type: 'object',
required: ['email', 'username', 'password'],
required: ['email', 'password'],
properties: {
email: {
type: 'string',
},
username: {
type: 'string',
},
password: {
type: 'string',
},
Expand Down Expand Up @@ -89,14 +86,11 @@ export class RegisterController {
'application/json': {
schema: {
type: 'object',
required: ['email', 'username', 'password', 'firstName', 'lastName', 'phoneNumber'],
required: ['email', 'password', 'firstName', 'lastName', 'phoneNumber'],
properties: {
email: {
type: 'string',
},
username: {
type: 'string',
},
password: {
type: 'string',
},
Expand Down Expand Up @@ -147,28 +141,22 @@ export class RegisterController {
'application/json': {
schema: {
type: 'object',
required: ['email', 'username', 'password', 'firstName', 'lastName', 'phoneNumber'],
required: ['email', 'password', 'phoneNumber', 'company'],
properties: {
email: {
type: 'string',
},
username: {
type: 'string',
},
password: {
type: 'string',
},
firstName: {
type: 'string',
},
lastName: {
type: 'string',
},
phoneNumber: {
type: 'string',
},
desc: {
type: 'string',
},
company: {
type: 'string',
}
},
},
Expand Down Expand Up @@ -205,14 +193,11 @@ export class RegisterController {
'application/json': {
schema: {
type: 'object',
required: ['email', 'username', 'password', 'firstName', 'lastName', 'phoneNumber'],
required: ['email', 'username', 'password', 'firstName', 'lastName', 'phoneNumber', 'company'],
properties: {
email: {
type: 'string',
},
username: {
type: 'string',
},
password: {
type: 'string',
},
Expand All @@ -227,6 +212,9 @@ export class RegisterController {
},
desc: {
type: 'string',
},
company: {
type: 'string',
}
},
},
Expand Down
2 changes: 1 addition & 1 deletion api/src/models/fsae-user.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export abstract class FsaeUser extends Entity {

@property({
type: 'string',
required: true,
required: false,
})
username: string;

Expand Down
6 changes: 6 additions & 0 deletions api/src/models/sponsor.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ export class Sponsor extends FsaeUser {
})
industry: string;

@property({
type: 'string',
required: false,
})
company: string;

// Indexer property to allow additional data
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[prop: string]: any;
Expand Down
Loading