mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
fixed date format
This commit is contained in:
parent
8b0be5fb89
commit
59e9b9df1d
@ -3,40 +3,28 @@ import format from 'date-fns/format'
|
||||
export default {
|
||||
Mutation: {
|
||||
CreateUser: async (resolve, root, args, context, info) => {
|
||||
try {
|
||||
args.createdAt = format(new Date())
|
||||
} catch (err) {}
|
||||
|
||||
args.createdAt = (new Date()).toISOString()
|
||||
args.disabled = false
|
||||
args.deleted = false
|
||||
const result = await resolve(root, args, context, info)
|
||||
return result
|
||||
},
|
||||
CreatePost: async (resolve, root, args, context, info) => {
|
||||
try {
|
||||
args.createdAt = format(new Date())
|
||||
} catch (err) {}
|
||||
|
||||
args.createdAt = (new Date()).toISOString()
|
||||
args.disabled = false
|
||||
args.deleted = false
|
||||
const result = await resolve(root, args, context, info)
|
||||
return result
|
||||
},
|
||||
CreateComment: async (resolve, root, args, context, info) => {
|
||||
try {
|
||||
args.createdAt = format(new Date())
|
||||
} catch (err) {}
|
||||
|
||||
args.createdAt = (new Date()).toISOString()
|
||||
args.disabled = false
|
||||
args.deleted = false
|
||||
const result = await resolve(root, args, context, info)
|
||||
return result
|
||||
},
|
||||
CreateOrganization: async (resolve, root, args, context, info) => {
|
||||
try {
|
||||
args.createdAt = format(new Date())
|
||||
} catch (err) {}
|
||||
|
||||
args.createdAt = (new Date()).toISOString()
|
||||
args.disabled = false
|
||||
args.deleted = false
|
||||
const result = await resolve(root, args, context, info)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { rule, shield, and, or, not, allow } from 'graphql-shield'
|
||||
|
||||
const isAuthenticated = rule()(async (parent, args, ctx, info) => {
|
||||
// TODO: how to get this working while seeding?
|
||||
console.log('isSeeding', process.env.IS_SEEDING)
|
||||
if (process.env.IS_SEEDING === true) {
|
||||
return true
|
||||
@ -8,6 +9,7 @@ const isAuthenticated = rule()(async (parent, args, ctx, info) => {
|
||||
return ctx.user !== null
|
||||
})
|
||||
const isOwner = rule()(async (parent, args, ctx, info) => {
|
||||
// TODO: how to get this working while seeding?
|
||||
console.log('isSeeding', process.env.IS_SEEDING)
|
||||
if (process.env.IS_SEEDING === true) {
|
||||
return true
|
||||
@ -16,6 +18,7 @@ const isOwner = rule()(async (parent, args, ctx, info) => {
|
||||
return ctx.user.id === parent.id
|
||||
})
|
||||
const isAdmin = rule()(async (parent, args, ctx, info) => {
|
||||
// TODO: how to get this working while seeding?
|
||||
console.log('isSeeding', process.env.IS_SEEDING)
|
||||
if (process.env.IS_SEEDING === true) {
|
||||
return true
|
||||
@ -23,6 +26,7 @@ const isAdmin = rule()(async (parent, args, ctx, info) => {
|
||||
return ctx.user.role === 'ADMIN'
|
||||
})
|
||||
const isModerator = rule()(async (parent, args, ctx, info) => {
|
||||
// TODO: how to get this working while seeding?
|
||||
console.log('isSeeding', process.env.IS_SEEDING)
|
||||
if (process.env.IS_SEEDING === true) {
|
||||
return true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user