This repository was archived by the owner on Jan 28, 2024. It is now read-only.
File tree 2 files changed +21
-3
lines changed
2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 110
110
'class ' => 'yii\rest\UrlRule ' ,
111
111
'controller ' => 'project-links ' ,
112
112
'extraPatterns ' => [
113
- 'POST {id}/share ' => 'share ' ,
114
- '{id}/share ' => 'options ' ,
113
+ 'GET,HEAD accessed ' => 'accessed ' ,
114
+ 'POST {id}/share ' => 'share ' ,
115
+ 'accessed ' => 'options ' ,
116
+ '{id}/share ' => 'options ' ,
115
117
],
116
118
],
117
119
// Guideline sections
Original file line number Diff line number Diff line change 15
15
class ProjectLinksController extends ApiController
16
16
{
17
17
/**
18
- * Returns paginated list with project links.
18
+ * Returns paginated list with owned project links.
19
19
*
20
20
* @return mixed
21
21
*/
@@ -148,4 +148,20 @@ public function actionShare($id)
148
148
149
149
return $ this ->sendErrorResponse ($ model ->getFirstErrors ());
150
150
}
151
+
152
+ /**
153
+ * Returns paginated list with recently accessed project links.
154
+ * Note: The user is not required to be owner of the related project.
155
+ *
156
+ * @return mixed
157
+ */
158
+ public function actionAccessed ()
159
+ {
160
+ $ user = Yii::$ app ->user ->identity ;
161
+
162
+ $ searchModel = new ProjectLinkSearch ($ user ->findAccessedProjectLinksQuery ());
163
+ $ dataProvider = $ searchModel ->search (Yii::$ app ->request ->get (), true );
164
+
165
+ return $ dataProvider ;
166
+ }
151
167
}
You can’t perform that action at this time.
0 commit comments