Skip to content

Commit

Permalink
updated mobile.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
DOOduneye committed Feb 20, 2024
1 parent 06bec76 commit 665e3dc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ permissions: read-all
on:
push:
paths:
- backend/**
- .github/workflows/backend.yml
- frontend/sac-mobile/**
- .github/workflows/mobile.yml
pull_request:
types: opened
paths:
- backend/**
- .github/workflows/backend.yml
- frontend/sac-mobile/**
- .github/workflows/mobile.yml

jobs:
lint:
Expand Down
10 changes: 6 additions & 4 deletions frontend/sac-mobile/services/auth.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from 'axios';

import { Tokens, User } from '@/types/user';
import { College, Tokens, User, Year } from '@/types/user';
import { API_BASE_URL } from '@/utils/const';

/**
Expand Down Expand Up @@ -55,16 +55,18 @@ export const register = async (
firstName: string,
lastName: string,
email: string,
password: string
password: string,
college: College,
year: Year
): Promise<User> => {
try {
const response = await axios.post(`${API_BASE_URL}/users/`, {
firstName,
lastName,
email,
password,
college: 'KKCS',
year: '3'
college,
year
});
return response.data;
} catch (error) {
Expand Down
16 changes: 16 additions & 0 deletions frontend/sac-mobile/types/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ export const userSchema = z.object({
updatedAt: z.date()
});

export const collegeSchema = z.enum([
'CAMD',
'DMSB',
'KCCS',
'CE',
'BCHS',
'SL',
'CPS',
'CS',
'CSSH'
]);
export type College = z.infer<typeof collegeSchema>;

export const yearSchema = z.enum(['1', '2', '3', '4', '5']);
export type Year = z.infer<typeof yearSchema>;

export type User = z.infer<typeof userSchema>;

export type Tokens = {
Expand Down

0 comments on commit 665e3dc

Please sign in to comment.