Save uploaded avatar to team
This commit is contained in:
1 parent
ac5e253d02
commit
ecc538648e
14 files changed
+255
-184
No files matched your search
@@ -1,5 +1,5 @@
|
||||
# source: http://localhost:4466
|
||||
# timestamp: Wed Sep 12 2018 08:41:57 GMT-0700 (Pacific Daylight Time)
|
||||
# timestamp: Thu Sep 20 2018 16:52:44 GMT-0700 (Pacific Daylight Time)
|
||||
|
||||
type AggregateFBStatus {
|
||||
count: Int!
|
||||
@@ -1400,7 +1400,9 @@ type TeamProfile {
|
||||
description: String
|
||||
motto: String
|
||||
avatar: String
|
||||
banner: String
|
||||
updatedAt: DateTime!
|
||||
createdAt: DateTime!
|
||||
}
|
||||
|
||||
"""A connection to a list of items."""
|
||||
@@ -1417,6 +1419,7 @@ input TeamProfileCreateInput {
|
||||
description: String
|
||||
motto: String
|
||||
avatar: String
|
||||
banner: String
|
||||
}
|
||||
|
||||
input TeamProfileCreateOneInput {
|
||||
@@ -1439,19 +1442,23 @@ enum TeamProfileOrderByInput {
|
||||
motto_DESC
|
||||
avatar_ASC
|
||||
avatar_DESC
|
||||
banner_ASC
|
||||
banner_DESC
|
||||
updatedAt_ASC
|
||||
updatedAt_DESC
|
||||
id_ASC
|
||||
id_DESC
|
||||
createdAt_ASC
|
||||
createdAt_DESC
|
||||
id_ASC
|
||||
id_DESC
|
||||
}
|
||||
|
||||
type TeamProfilePreviousValues {
|
||||
description: String
|
||||
motto: String
|
||||
avatar: String
|
||||
banner: String
|
||||
updatedAt: DateTime!
|
||||
createdAt: DateTime!
|
||||
}
|
||||
|
||||
type TeamProfileSubscriptionPayload {
|
||||
@@ -1497,12 +1504,14 @@ input TeamProfileUpdateDataInput {
|
||||
description: String
|
||||
motto: String
|
||||
avatar: String
|
||||
banner: String
|
||||
}
|
||||
|
||||
input TeamProfileUpdateInput {
|
||||
description: String
|
||||
motto: String
|
||||
avatar: String
|
||||
banner: String
|
||||
}
|
||||
|
||||
input TeamProfileUpdateOneInput {
|
||||
@@ -1647,6 +1656,46 @@ input TeamProfileWhereInput {
|
||||
|
||||
"""All values not ending with the given string."""
|
||||
avatar_not_ends_with: String
|
||||
banner: String
|
||||
|
||||
"""All values that are not equal to given value."""
|
||||
banner_not: String
|
||||
|
||||
"""All values that are contained in given list."""
|
||||
banner_in: [String!]
|
||||
|
||||
"""All values that are not contained in given list."""
|
||||
banner_not_in: [String!]
|
||||
|
||||
"""All values less than the given value."""
|
||||
banner_lt: String
|
||||
|
||||
"""All values less than or equal the given value."""
|
||||
banner_lte: String
|
||||
|
||||
"""All values greater than the given value."""
|
||||
banner_gt: String
|
||||
|
||||
"""All values greater than or equal the given value."""
|
||||
banner_gte: String
|
||||
|
||||
"""All values containing the given string."""
|
||||
banner_contains: String
|
||||
|
||||
"""All values not containing the given string."""
|
||||
banner_not_contains: String
|
||||
|
||||
"""All values starting with the given string."""
|
||||
banner_starts_with: String
|
||||
|
||||
"""All values not starting with the given string."""
|
||||
banner_not_starts_with: String
|
||||
|
||||
"""All values ending with the given string."""
|
||||
banner_ends_with: String
|
||||
|
||||
"""All values not ending with the given string."""
|
||||
banner_not_ends_with: String
|
||||
updatedAt: DateTime
|
||||
|
||||
"""All values that are not equal to given value."""
|
||||
@@ -1669,6 +1718,28 @@ input TeamProfileWhereInput {
|
||||
|
||||
"""All values greater than or equal the given value."""
|
||||
updatedAt_gte: DateTime
|
||||
createdAt: DateTime
|
||||
|
||||
"""All values that are not equal to given value."""
|
||||
createdAt_not: DateTime
|
||||
|
||||
"""All values that are contained in given list."""
|
||||
createdAt_in: [DateTime!]
|
||||
|
||||
"""All values that are not contained in given list."""
|
||||
createdAt_not_in: [DateTime!]
|
||||
|
||||
"""All values less than the given value."""
|
||||
createdAt_lt: DateTime
|
||||
|
||||
"""All values less than or equal the given value."""
|
||||
createdAt_lte: DateTime
|
||||
|
||||
"""All values greater than the given value."""
|
||||
createdAt_gt: DateTime
|
||||
|
||||
"""All values greater than or equal the given value."""
|
||||
createdAt_gte: DateTime
|
||||
}
|
||||
|
||||
type TeamStatus {
|
||||
|
||||
@@ -13,6 +13,7 @@ const TEAMS_FRAGMENT = gql`{
|
||||
createdAt
|
||||
profile {
|
||||
avatar
|
||||
banner
|
||||
description
|
||||
motto
|
||||
updatedAt
|
||||
|
||||
+7
-6
@@ -121,8 +121,8 @@ const resolvers = {
|
||||
return err
|
||||
})
|
||||
},
|
||||
async updateTeamProfile(parent, { slug, owner, description, motto, avatar }, ctx, info) {
|
||||
return ctx.db.mutation.updateTeam({data:{profile: {update: {description: description, motto: motto, avatar: avatar}}}, where:{slug: slug}}, TEAMS_FRAGMENT)
|
||||
async updateTeamProfile(parent, { slug, owner, description, motto, avatar, banner }, ctx, info) {
|
||||
return ctx.db.mutation.updateTeam({data:{profile: {update: {description: description, motto: motto, avatar: avatar, banner: banner}}}, where:{slug: slug}}, TEAMS_FRAGMENT)
|
||||
.catch((err) => {
|
||||
console.log('createTeam error: ', err)
|
||||
return err
|
||||
@@ -140,8 +140,8 @@ const resolvers = {
|
||||
async getAzureSAS(parent, { teamSlug }, ctx, info) {
|
||||
// Create start and expiry times
|
||||
let today = new Date()
|
||||
let tomorrow = new Date()
|
||||
tomorrow.setDate(today.getDate() + 7)
|
||||
let week = new Date()
|
||||
week.setDate(today.getDate() + 7)
|
||||
// Create SharedKeyCredential and attach to pipline
|
||||
const SKC = new Azure.SharedKeyCredential(azureAccount, azureKey)
|
||||
const pipeline = Azure.StorageURL.newPipeline(SKC)
|
||||
@@ -179,10 +179,11 @@ const resolvers = {
|
||||
// Generate SAS url
|
||||
const SASQueryParameters = Azure.generateAccountSASQueryParameters(
|
||||
{
|
||||
containerName,
|
||||
version: '2017-11-09',
|
||||
permissions: SASContainerPerms,
|
||||
startTime: today,
|
||||
expiryTime: tomorrow,
|
||||
expiryTime: week,
|
||||
protocol: 'https',
|
||||
services: SASServicePerms,
|
||||
resourceTypes: SASResourceTypes
|
||||
}, SKC )
|
||||
|
||||
@@ -19,16 +19,11 @@ type Query {
|
||||
type Mutation {
|
||||
authenticate(idToken: String!): Member
|
||||
createTeam(name: String!, slug: String!, owner: String!): Team @isAuthenticated
|
||||
updateTeamProfile(slug: String!, owner: String!, description: String, motto: String, avatar: String): Team @isAuthenticated
|
||||
updateTeamProfile(slug: String!, owner: String!, description: String, motto: String, avatar: String, banner: String): Team @isAuthenticated
|
||||
deleteTeam(slug: String!): Team @isAuthenticated @isOwner(type: "Team")
|
||||
getAzureSAS(teamSlug: String!):String
|
||||
}
|
||||
|
||||
input MemberProfileInput {
|
||||
authId: String!
|
||||
alias: String!
|
||||
}
|
||||
|
||||
fragment MemberInfo on Member {
|
||||
id
|
||||
authId
|
||||
|
||||
Reference in new issue
Block a user