Commit db4d594
committed
Add admin flag, refactor user-related code
- Introduce is_admin flag in member table and user-related functions
- Update createOrReturnID to return is_admin status
- Automatically set first user as admin
- Refactor User struct to include IsAdmin field
- Update GetUser function to handle new IsAdmin field
- Modify UserMiddleware to set is_admin in context
- Remove unused model structs (Favorite, MemberPref, Message, etc.)
- Update CreateOrReturnID query to return both ID and is_admin status
- Adjust tests to accommodate new is_admin functionality
- Update mock functions and test cases for user-related operations
- Replace os.Stderr with io.Discard in test logger for clean test output
Change-Id: I6238f1e736e6924d32f95c0f41b48578f86104f6
Signed-off-by: Ian Meyer <[email protected]>1 parent 3672b88 commit db4d594
File tree
7 files changed
+135
-118
lines changed- sqlc
7 files changed
+135
-118
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
396 | 397 | | |
397 | 398 | | |
398 | 399 | | |
399 | | - | |
| 400 | + | |
400 | 401 | | |
401 | 402 | | |
402 | 403 | | |
| |||
1024 | 1025 | | |
1025 | 1026 | | |
1026 | 1027 | | |
1027 | | - | |
| 1028 | + | |
1028 | 1029 | | |
1029 | 1030 | | |
1030 | 1031 | | |
1031 | 1032 | | |
1032 | 1033 | | |
1033 | 1034 | | |
1034 | | - | |
| 1035 | + | |
| 1036 | + | |
1035 | 1037 | | |
1036 | | - | |
| 1038 | + | |
1037 | 1039 | | |
1038 | 1040 | | |
1039 | 1041 | | |
| |||
1049 | 1051 | | |
1050 | 1052 | | |
1051 | 1053 | | |
1052 | | - | |
| 1054 | + | |
1053 | 1055 | | |
1054 | 1056 | | |
1055 | 1057 | | |
1056 | 1058 | | |
1057 | 1059 | | |
1058 | | - | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
1059 | 1067 | | |
1060 | 1068 | | |
1061 | 1069 | | |
| |||
0 commit comments