Browse Source

added 2 columns to the user table

dmr1725 4 years ago
parent
commit
430cdce3b4

+ 2
- 2
client/App.js View File

39
 
39
 
40
         try {
40
         try {
41
           // login user in backend
41
           // login user in backend
42
-          let response = await fetch('http://356b92b5f6b5.ngrok.io/rest-auth/google/', {
42
+          let response = await fetch('http://8c4029a33a9a.ngrok.io/rest-auth/google/', {
43
             method: 'POST',
43
             method: 'POST',
44
             headers: {
44
             headers: {
45
               'content-type': 'application/json'
45
               'content-type': 'application/json'
60
           const token = await SecureStore.getItemAsync('token')
60
           const token = await SecureStore.getItemAsync('token')
61
 
61
 
62
           // storing our id
62
           // storing our id
63
-          let id = await fetch('http://356b92b5f6b5.ngrok.io/api/get_user_id', {
63
+          let id = await fetch('http://8c4029a33a9a.ngrok.io/api/get_user_id', {
64
             method: 'GET',
64
             method: 'GET',
65
             headers: {
65
             headers: {
66
               'content-type': 'application/json',
66
               'content-type': 'application/json',

+ 2
- 2
client/Screens/AddTakenCourse.js View File

51
 
51
 
52
       let response = await axios({
52
       let response = await axios({
53
         method: 'POST',
53
         method: 'POST',
54
-        url: 'http://356b92b5f6b5.ngrok.io/api/add_taken_course',
54
+        url: 'http://8c4029a33a9a.ngrok.io/api/add_taken_course',
55
         headers: {
55
         headers: {
56
           'content-type': 'application/json',
56
           'content-type': 'application/json',
57
           Authorization: `Token ${token}`
57
           Authorization: `Token ${token}`
85
       const token = await SecureStore.getItemAsync('token')
85
       const token = await SecureStore.getItemAsync('token')
86
       const response = await axios({
86
       const response = await axios({
87
           method: 'GET',
87
           method: 'GET',
88
-          url: `http://356b92b5f6b5.ngrok.io/api/find_course?code=${text}`,
88
+          url: `http://8c4029a33a9a.ngrok.io/api/find_course?code=${text}`,
89
           headers: {
89
           headers: {
90
             'content-type': 'application/json',
90
             'content-type': 'application/json',
91
             Authorization: `Token ${token}`
91
             Authorization: `Token ${token}`

+ 1
- 1
client/Screens/HomeScreen.js View File

13
     console.log(token, id)
13
     console.log(token, id)
14
 
14
 
15
     let response = await Axios({
15
     let response = await Axios({
16
-      url: 'http://356b92b5f6b5.ngrok.io/api/hello',
16
+      url: 'http://8c4029a33a9a.ngrok.io/api/hello',
17
       method: 'GET',
17
       method: 'GET',
18
       headers: {
18
       headers: {
19
           Authorization: `Token ${token}`
19
           Authorization: `Token ${token}`

+ 2
- 2
client/Screens/MyCurriculum.js View File

20
         let user_id = parseInt(id)
20
         let user_id = parseInt(id)
21
 
21
 
22
         try {
22
         try {
23
-            let response = await axios('http://356b92b5f6b5.ngrok.io/api/see_gpa', {
23
+            let response = await axios('http://8c4029a33a9a.ngrok.io/api/see_gpa', {
24
                 method: 'POST',
24
                 method: 'POST',
25
                 headers: {
25
                 headers: {
26
                     Authorization: `Token ${token}`
26
                     Authorization: `Token ${token}`
43
         let numbers = []
43
         let numbers = []
44
 
44
 
45
         try {
45
         try {
46
-            let response = await axios(`http://356b92b5f6b5.ngrok.io/api/get_all_courses_by_semester?user_id=${user_id}&year=${year}&semestre=${semester}`, {
46
+            let response = await axios(`http://8c4029a33a9a.ngrok.io/api/get_all_courses_by_semester?user_id=${user_id}&year=${year}&semestre=${semester}`, {
47
                 method: 'GET',
47
                 method: 'GET',
48
                 headers: {
48
                 headers: {
49
                     'content-type': 'application/json',
49
                     'content-type': 'application/json',

+ 2
- 2
client/Screens/SettingScreen.js View File

15
         let user_id = parseInt(id)
15
         let user_id = parseInt(id)
16
 
16
 
17
        try {
17
        try {
18
-        let response = await axios(`http://356b92b5f6b5.ngrok.io/api/get_faculty_name?id=${user_id}`, {
18
+        let response = await axios(`http://8c4029a33a9a.ngrok.io/api/get_faculty_name?id=${user_id}`, {
19
             method: 'GET',
19
             method: 'GET',
20
             headers: {
20
             headers: {
21
                 'content-type': 'application/json',
21
                 'content-type': 'application/json',
43
         try {
43
         try {
44
             let response = await axios({
44
             let response = await axios({
45
                 method: 'PATCH',
45
                 method: 'PATCH',
46
-                url: 'http://356b92b5f6b5.ngrok.io/api/update_faculty',
46
+                url: 'http://8c4029a33a9a.ngrok.io/api/update_faculty',
47
                 headers: {
47
                 headers: {
48
                     Authorization: `Token ${token}`
48
                     Authorization: `Token ${token}`
49
                 },
49
                 },

+ 1
- 0
client/debug.log View File

1
+[1130/124344.155:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)

BIN
server/CompanionApp/__pycache__/models.cpython-38.pyc View File


+ 23
- 0
server/CompanionApp/migrations/0011_auto_20201207_0948.py View File

1
+# Generated by Django 3.0.8 on 2020-12-07 13:48
2
+
3
+from django.db import migrations, models
4
+
5
+
6
+class Migration(migrations.Migration):
7
+
8
+    dependencies = [
9
+        ('CompanionApp', '0010_user_credits_taken_score'),
10
+    ]
11
+
12
+    operations = [
13
+        migrations.AddField(
14
+            model_name='user',
15
+            name='current_semester',
16
+            field=models.IntegerField(default=1),
17
+        ),
18
+        migrations.AddField(
19
+            model_name='user',
20
+            name='current_year',
21
+            field=models.IntegerField(default=1),
22
+        ),
23
+    ]

BIN
server/CompanionApp/migrations/__pycache__/0011_auto_20201207_0948.cpython-38.pyc View File


+ 2
- 0
server/CompanionApp/models.py View File

17
     fac_id = models.ForeignKey(Facultad, on_delete=models.CASCADE, default=1)
17
     fac_id = models.ForeignKey(Facultad, on_delete=models.CASCADE, default=1)
18
     credits_taken = models.IntegerField(default=0)
18
     credits_taken = models.IntegerField(default=0)
19
     credits_taken_score = models.IntegerField(default=0)
19
     credits_taken_score = models.IntegerField(default=0)
20
+    current_year = models.IntegerField(default=1)
21
+    current_semester = models.IntegerField(default=1)
20
 
22
 
21
 class Matricula(models.Model):
23
 class Matricula(models.Model):
22
     user_id = models.ForeignKey(User, on_delete=models.CASCADE, default=1)
24
     user_id = models.ForeignKey(User, on_delete=models.CASCADE, default=1)