| @@ 59-65 (lines=7) @@ | ||
| 56 | $user_widget->size_y = $request->size_y; | |
| 57 | $user_widget->title = $request->title; | |
| 58 | $user_widget->dashboard_id = $request->dashboard_id; | |
| 59 |         if ($user_widget->save()) { | |
| 60 |             return $this->response->array(array('statusText' => 'OK', 'user_widget_id' => $user_widget->user_widget_id)); | |
| 61 |         } else { | |
| 62 | return $this->response->errorInternal(); | |
| 63 | } | |
| 64 | } | |
| 65 | ||
| 66 | /** | |
| 67 | * Display the specified resource. | |
| 68 | * | |
| @@ 141-147 (lines=7) @@ | ||
| 138 | public function destroy(Request $request, $id) | |
| 139 |     { | |
| 140 |         if (Dashboard::where('user_id', $request->user()->user_id)->where('dashboard_id', $id)->delete()) { | |
| 141 |             if (UsersWidgets::where('dashboard_id', $id)->delete() >= 0) { | |
| 142 |                 return $this->response->array(array('statusText' => 'OK')); | |
| 143 |             } else { | |
| 144 | return $this->response->errorInternal(); | |
| 145 | } | |
| 146 |         } else { | |
| 147 | return $this->response->errorInternal(); | |
| 148 | } | |
| 149 | } | |
| 150 | ||
| @@ 46-51 (lines=6) @@ | ||
| 43 | $result = $notification->markSticky(false); | |
| 44 | } | |
| 45 | ||
| 46 |         if ($result === false) { | |
| 47 | return $this->response->errorInternal(); | |
| 48 |         } else { | |
| 49 |             return $this->response->array(array('statusText' => 'OK')); | |
| 50 | } | |
| 51 | } | |
| 52 | ||
| 53 | /** | |
| 54 | * Create a new notification | |
| @@ 65-71 (lines=7) @@ | ||
| 62 | $notification->body = $request->body; | |
| 63 |         $notification->checksum = hash('sha512', $request->user()->user_id.'.LOCAL.'.$request->title); | |
| 64 | $notification->source = $request->user()->user_id; | |
| 65 |         if ($notification->save()) { | |
| 66 |             return $this->response->array(array('statusText' => 'OK')); | |
| 67 |         } else { | |
| 68 | return $this->response->errorInternal(); | |
| 69 | } | |
| 70 | } | |
| 71 | } | |
| 72 | ||