Skip to content

Commit

Permalink
Merge pull request #77 from UoaWDCC/signup-login-fix-yang
Browse files Browse the repository at this point in the history
signup/login fix by removing username as req
  • Loading branch information
Kinzi-c authored Sep 22, 2024
2 parents 3db3e55 + 1653d51 commit ecaec53
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
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

0 comments on commit ecaec53

Please sign in to comment.