Commit 62bede0
committed
refactor: refactor secret creation and update logic
- Modify the function `CreateOrUpdateOrgSecret` in `routers/api/v1/org/action.go`
- Replace the call to `secret_model.UpdateSecret` with `secret_model.CreateOrUpdateSecret`
- Remove the block of code that handles the case when the secret is not found
- Remove the call to `secret_model.InsertEncryptedSecret`
- Add a new variable `isCreated` to check if the secret was created or updated
- Update the error handling for the function `CreateOrUpdateOrgSecret`
- Modify the function `CreateOrUpdateSecret` in `routers/api/v1/repo/action.go`
- Replace the call to `secret_model.UpdateSecret` with `secret_model.CreateOrUpdateSecret`
- Remove the block of code that handles the case when the secret is not found
- Remove the call to `secret_model.InsertEncryptedSecret`
- Add a new variable `isCreated` to check if the secret was created or updated
- Update the error handling for the function `CreateOrUpdateSecret`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>1 parent 52735c7 commit 62bede0
2 files changed
+10
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
127 | 118 | | |
128 | 119 | | |
129 | | - | |
130 | | - | |
| 120 | + | |
| 121 | + | |
131 | 122 | | |
132 | 123 | | |
133 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
76 | 67 | | |
77 | 68 | | |
78 | | - | |
79 | | - | |
| 69 | + | |
| 70 | + | |
80 | 71 | | |
81 | 72 | | |
82 | 73 | | |
| |||
0 commit comments