forked from DebaucheryLibrarian/traxxx
Added campaign retrieval function, added banner to homepage.
This commit is contained in:
@@ -227,6 +227,46 @@ function initUiActions(store, _router) {
|
||||
};
|
||||
}
|
||||
|
||||
async function fetchRandomCampaign(context, { minRatio, maxRatio }) {
|
||||
const { randomCampaign } = await graphql(`
|
||||
query Campaign(
|
||||
$minRatio: BigFloat
|
||||
$maxRatio: BigFloat
|
||||
) {
|
||||
randomCampaign: getRandomCampaign(minRatio: $minRatio, maxRatio: $maxRatio) {
|
||||
url
|
||||
affiliate {
|
||||
url
|
||||
}
|
||||
banner {
|
||||
id
|
||||
type
|
||||
ratio
|
||||
entity {
|
||||
type
|
||||
slug
|
||||
parent {
|
||||
type
|
||||
slug
|
||||
}
|
||||
}
|
||||
}
|
||||
entity {
|
||||
slug
|
||||
}
|
||||
parent {
|
||||
slug
|
||||
}
|
||||
}
|
||||
}
|
||||
`, {
|
||||
minRatio,
|
||||
maxRatio,
|
||||
});
|
||||
|
||||
return randomCampaign;
|
||||
}
|
||||
|
||||
async function fetchStats() {
|
||||
const {
|
||||
scenes,
|
||||
@@ -273,6 +313,7 @@ function initUiActions(store, _router) {
|
||||
setBatch,
|
||||
setSfw,
|
||||
setTheme,
|
||||
fetchRandomCampaign,
|
||||
fetchNotifications,
|
||||
fetchStats,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user