-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dashboard] Getting tutorials feed from proxy (#1251)
* [dashboard] Getting tutorials feed from proxy * [dashboard] Use correct url to guide
- Loading branch information
Kristoffer J. Sivertsen
committed
Mar 27, 2019
1 parent
0e63be0
commit 95380a5
Showing
2 changed files
with
6 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 4 additions & 22 deletions
26
packages/@sanity/dashboard/src/widgets/sanityTutorials/dataAdapter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,14 @@ | ||
import client from 'part:@sanity/base/client' | ||
import sanityClient from '@sanity/client' | ||
import imageUrlBuilder from '@sanity/image-url' | ||
|
||
// We're connecting to | ||
const client = sanityClient({ | ||
const configuredClient = sanityClient({ | ||
projectId: '3do82whm', | ||
dataset: 'production', | ||
useCdn: true | ||
}) | ||
|
||
const query = ` | ||
*[_id == 'dashboardFeed-v1'] { | ||
items[]-> { | ||
_id, | ||
title, | ||
poster, | ||
youtubeURL, | ||
"presenter": authors[0]-> {name, mugshot, bio}, | ||
guideOrTutorial-> { | ||
title, | ||
slug, | ||
"presenter": authors[0]-> {name, mugshot, bio}, | ||
_createdAt | ||
} | ||
} | ||
}[0] | ||
` | ||
|
||
export default { | ||
getFeed: () => client.observable.fetch(query), | ||
urlBuilder: imageUrlBuilder(client) | ||
getFeed: () => client.request({uri: '/addons/dashboard', withCredentials: false}), | ||
urlBuilder: imageUrlBuilder(configuredClient) | ||
} |