mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update Story apis, move FE to v0 and add v1 for oauth clients
This commit is contained in:
parent
e2828f4b85
commit
92654fabdc
8 changed files with 23 additions and 14 deletions
|
@ -680,6 +680,7 @@ export default {
|
|||
let self = this;
|
||||
self.status = response.data.status;
|
||||
self.user = response.data.user;
|
||||
window._sharedData.curUser = self.user;
|
||||
self.media = self.status.media_attachments;
|
||||
self.reactions = response.data.reactions;
|
||||
self.likes = response.data.likes;
|
||||
|
|
|
@ -642,7 +642,7 @@
|
|||
axios.get('/api/pixelfed/v1/accounts/verify_credentials').then(res => {
|
||||
this.user = res.data;
|
||||
if(res.data.id == this.profileId || this.relationship.following == true) {
|
||||
axios.get('/api/stories/v1/exists/' + this.profileId)
|
||||
axios.get('/api/stories/v0/exists/' + this.profileId)
|
||||
.then(res => {
|
||||
this.hasStory = res.data == true;
|
||||
})
|
||||
|
|
|
@ -177,7 +177,7 @@
|
|||
|
||||
mounted() {
|
||||
this.mediaWatcher();
|
||||
axios.get('/api/stories/v1/fetch/' + this.profileId)
|
||||
axios.get('/api/stories/v0/fetch/' + this.profileId)
|
||||
.then(res => this.stories = res.data);
|
||||
},
|
||||
|
||||
|
@ -226,7 +226,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
axios.post('/api/stories/v1/add', form, xhrConfig)
|
||||
axios.post('/api/stories/v0/add', form, xhrConfig)
|
||||
.then(function(e) {
|
||||
self.uploadProgress = 100;
|
||||
self.uploading = false;
|
||||
|
@ -264,7 +264,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
axios.delete('/api/stories/v1/delete/' + story.id)
|
||||
axios.delete('/api/stories/v0/delete/' + story.id)
|
||||
.then(res => {
|
||||
this.stories.splice(index, 1);
|
||||
if(this.stories.length == 0) {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
methods: {
|
||||
fetchStories() {
|
||||
axios.get('/api/stories/v1/recent')
|
||||
axios.get('/api/stories/v0/recent')
|
||||
.then(res => {
|
||||
let data = res.data;
|
||||
let stories = new Zuck('storyContainer', {
|
||||
|
@ -57,7 +57,7 @@
|
|||
});
|
||||
|
||||
data.forEach(d => {
|
||||
let url = '/api/stories/v1/fetch/' + d.pid;
|
||||
let url = '/api/stories/v0/fetch/' + d.pid;
|
||||
axios.get(url)
|
||||
.then(res => {
|
||||
res.data.forEach(item => {
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
methods: {
|
||||
fetchStories() {
|
||||
axios.get('/api/stories/v1/profile/' + this.pid)
|
||||
axios.get('/api/stories/v0/profile/' + this.pid)
|
||||
.then(res => {
|
||||
let data = res.data;
|
||||
if(data.length == 0) {
|
||||
|
|
|
@ -1424,7 +1424,7 @@
|
|||
},
|
||||
|
||||
hasStory() {
|
||||
axios.get('/api/stories/v1/exists/'+this.profile.id)
|
||||
axios.get('/api/stories/v0/exists/'+this.profile.id)
|
||||
.then(res => {
|
||||
this.userStory = res.data;
|
||||
})
|
||||
|
|
|
@ -67,4 +67,12 @@ Route::group(['prefix' => 'api'], function() use($middleware) {
|
|||
Route::get('timelines/public', 'Api\ApiV1Controller@timelinePublic');
|
||||
Route::get('timelines/tag/{hashtag}', 'Api\ApiV1Controller@timelineHashtag')->middleware($middleware);
|
||||
});
|
||||
Route::group(['prefix' => 'stories'], function () {
|
||||
Route::get('v1/recent', 'StoryController@apiV1Recent');
|
||||
Route::post('v1/add', 'StoryController@apiV1Add')->middleware('throttle:maxStoriesPerDay,1440');
|
||||
Route::get('v1/fetch/{id}', 'StoryController@apiV1Fetch');
|
||||
Route::get('v1/profile/{id}', 'StoryController@apiV1Profile');
|
||||
Route::get('v1/exists/{id}', 'StoryController@apiV1Exists');
|
||||
Route::delete('v1/delete/{id}', 'StoryController@apiV1Delete')->middleware('throttle:maxStoryDeletePerDay,1440');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -179,12 +179,12 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact
|
|||
Route::post('moderate', 'Api\AdminApiController@moderate');
|
||||
});
|
||||
Route::group(['prefix' => 'stories'], function () {
|
||||
Route::get('v1/recent', 'StoryController@apiV1Recent');
|
||||
Route::post('v1/add', 'StoryController@apiV1Add')->middleware('throttle:maxStoriesPerDay,1440');
|
||||
Route::get('v1/fetch/{id}', 'StoryController@apiV1Fetch');
|
||||
Route::get('v1/profile/{id}', 'StoryController@apiV1Profile');
|
||||
Route::get('v1/exists/{id}', 'StoryController@apiV1Exists');
|
||||
Route::delete('v1/delete/{id}', 'StoryController@apiV1Delete')->middleware('throttle:maxStoryDeletePerDay,1440');
|
||||
Route::get('v0/recent', 'StoryController@apiV1Recent');
|
||||
Route::post('v0/add', 'StoryController@apiV1Add')->middleware('throttle:maxStoriesPerDay,1440');
|
||||
Route::get('v0/fetch/{id}', 'StoryController@apiV1Fetch');
|
||||
Route::get('v0/profile/{id}', 'StoryController@apiV1Profile');
|
||||
Route::get('v0/exists/{id}', 'StoryController@apiV1Exists');
|
||||
Route::delete('v0/delete/{id}', 'StoryController@apiV1Delete')->middleware('throttle:maxStoryDeletePerDay,1440');
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue