-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented illustrators, pokemon and trainer collections
- Loading branch information
Showing
9 changed files
with
395 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import type { CollectionConfig } from "payload/types"; | ||
|
||
import { isStaff } from "../../db/collections/users/users.access"; | ||
|
||
export const Illustrators: CollectionConfig = { | ||
slug: "illustrators", | ||
labels: { singular: "illustrator", plural: "illustrators" }, | ||
admin: { | ||
group: "Custom", | ||
useAsTitle: "name", | ||
}, | ||
access: { | ||
create: isStaff, | ||
read: () => true, | ||
update: isStaff, | ||
delete: isStaff, | ||
}, | ||
fields: [ | ||
{ | ||
name: "id", | ||
type: "text", | ||
}, | ||
{ | ||
name: "name", | ||
type: "text", | ||
}, | ||
{ | ||
name: "cards", | ||
type: "relationship", | ||
relationTo: ["pokemon-cards", "trainer-cards"], | ||
hasMany: true, | ||
}, | ||
{ | ||
name: "checksum", | ||
type: "text", | ||
required: true, | ||
}, | ||
], | ||
}; |
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 +1,19 @@ | ||
export const CustomCollections = []; | ||
import { Illustrators } from "./illustrators"; | ||
import { PokemonAbilities } from "./pokemon-abilities"; | ||
import { PokemonAttacks } from "./pokemon-attacks"; | ||
import { PokemonCards } from "./pokemon-cards"; | ||
import { PokemonTypes } from "./pokemon-types"; | ||
import { Rarities } from "./rarities"; | ||
import { TrainerCardTypes } from "./trainer-card-types"; | ||
import { TrainerCards } from "./trainer-cards"; | ||
|
||
export const CustomCollections = [ | ||
Illustrators, | ||
PokemonAbilities, | ||
PokemonAttacks, | ||
PokemonCards, | ||
PokemonTypes, | ||
Rarities, | ||
TrainerCards, | ||
TrainerCardTypes | ||
] |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import type { CollectionConfig } from "payload/types"; | ||
|
||
import { isStaff } from "../../db/collections/users/users.access"; | ||
|
||
export const PokemonAbilities: CollectionConfig = { | ||
slug: "pokemon-abilities", | ||
labels: { singular: "pokemon-ability", plural: "pokemon-abilities" }, | ||
admin: { | ||
group: "Custom", | ||
useAsTitle: "name", | ||
}, | ||
access: { | ||
create: isStaff, | ||
read: () => true, | ||
update: isStaff, | ||
delete: isStaff, | ||
}, | ||
fields: [ | ||
{ | ||
name: "id", | ||
type: "text", | ||
}, | ||
{ | ||
name: "name", | ||
type: "text", | ||
}, | ||
{ | ||
name: "desc", | ||
type: "text", | ||
}, | ||
{ | ||
name: "checksum", | ||
type: "text", | ||
required: true, | ||
}, | ||
], | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import type { CollectionConfig } from "payload/types"; | ||
|
||
import { isStaff } from "../../db/collections/users/users.access"; | ||
|
||
export const PokemonAttacks: CollectionConfig = { | ||
slug: "pokemon-attacks", | ||
labels: { singular: "pokemon-attack", plural: "pokemon-attacks" }, | ||
admin: { | ||
group: "Custom", | ||
useAsTitle: "name", | ||
}, | ||
access: { | ||
create: isStaff, | ||
read: () => true, | ||
update: isStaff, | ||
delete: isStaff, | ||
}, | ||
fields: [ | ||
{ | ||
name: "id", | ||
type: "text", | ||
}, | ||
{ | ||
name: "name", | ||
type: "text", | ||
}, | ||
{ | ||
name: "desc", | ||
type: "text", | ||
}, | ||
{ | ||
name: "is_damaging", | ||
type: "checkbox", | ||
}, | ||
{ | ||
name: "damage", | ||
type: "number", | ||
}, | ||
{ | ||
name: "cost", | ||
type: "array", | ||
fields: [ | ||
{ | ||
name: "type", | ||
type: "relationship", | ||
relationTo: "pokemon-types", | ||
}, | ||
{ | ||
name: "amount", | ||
type: "number", | ||
}, | ||
], | ||
}, | ||
{ | ||
name: "checksum", | ||
type: "text", | ||
required: true, | ||
}, | ||
], | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import type { CollectionConfig } from "payload/types"; | ||
|
||
import { isStaff } from "../../db/collections/users/users.access"; | ||
|
||
export const PokemonCards: CollectionConfig = { | ||
slug: "pokemon-cards", | ||
labels: { singular: "pokemon-card", plural: "pokemon-cards" }, | ||
admin: { | ||
group: "Custom", | ||
useAsTitle: "name", | ||
}, | ||
access: { | ||
create: isStaff, | ||
read: () => true, | ||
update: isStaff, | ||
delete: isStaff, | ||
}, | ||
fields: [ | ||
{ | ||
name: "id", | ||
type: "text", | ||
}, | ||
{ | ||
name: "slug", | ||
type: "text", | ||
}, | ||
{ | ||
name: "name", | ||
type: "text", | ||
}, | ||
{ | ||
name: "desc", | ||
type: "text" | ||
}, | ||
{ | ||
name: "rarity", | ||
type: "relationship", | ||
relationTo: "rarities", | ||
}, | ||
{ | ||
name: "hp", | ||
type: "number", | ||
}, | ||
{ | ||
name: "type", | ||
relationTo: "pokemon-types", | ||
type: "relationship", | ||
}, | ||
{ | ||
name: "weakness_type", | ||
relationTo: "pokemon-types", | ||
type: "relationship", | ||
}, | ||
{ | ||
name: "retreat_cost", | ||
type: "number", | ||
}, | ||
{ | ||
name: "is_ex", | ||
type: "checkbox", | ||
}, | ||
{ | ||
name: "attacks", | ||
type: "relationship", | ||
relationTo: "pokemon-attacks", | ||
}, | ||
{ | ||
name: "abilities", | ||
type: "relationship", | ||
relationTo: "pokemon-abilities", | ||
}, | ||
{ | ||
name: "illustrators", | ||
type: "relationship", | ||
relationTo: "illustrators", | ||
hasMany: true, | ||
}, | ||
{ | ||
name: "checksum", | ||
type: "text", | ||
required: true, | ||
}, | ||
], | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { CollectionConfig } from "payload/types"; | ||
|
||
import { isStaff } from "../../db/collections/users/users.access"; | ||
|
||
export const PokemonTypes: CollectionConfig = { | ||
slug: "pokemon-types", | ||
labels: { singular: "pokemon-type", plural: "pokemon-types" }, | ||
admin: { | ||
group: "Custom", | ||
useAsTitle: "name", | ||
}, | ||
access: { | ||
create: isStaff, | ||
read: () => true, | ||
update: isStaff, | ||
delete: isStaff, | ||
}, | ||
fields: [ | ||
{ | ||
name: "id", | ||
type: "text", | ||
}, | ||
{ | ||
name: "name", | ||
type: "text", | ||
}, | ||
{ | ||
name: "checksum", | ||
type: "text", | ||
required: true, | ||
}, | ||
], | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { CollectionConfig } from "payload/types"; | ||
|
||
import { isStaff } from "../../db/collections/users/users.access"; | ||
|
||
export const Rarities: CollectionConfig = { | ||
slug: "rarities", | ||
labels: { singular: "rarity", plural: "rarities" }, | ||
admin: { | ||
group: "Custom", | ||
useAsTitle: "name", | ||
}, | ||
access: { | ||
create: isStaff, | ||
read: () => true, | ||
update: isStaff, | ||
delete: isStaff, | ||
}, | ||
fields: [ | ||
{ | ||
name: "id", | ||
type: "text", | ||
}, | ||
{ | ||
name: "name", | ||
type: "text", | ||
}, | ||
{ | ||
name: "checksum", | ||
type: "text", | ||
required: true, | ||
}, | ||
], | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { CollectionConfig } from "payload/types"; | ||
|
||
import { isStaff } from "../../db/collections/users/users.access"; | ||
|
||
export const TrainerCardTypes: CollectionConfig = { | ||
slug: "trainer-card-types", | ||
labels: { singular: "trainer-card-type", plural: "trainer-card-types" }, | ||
admin: { | ||
group: "Custom", | ||
useAsTitle: "name", | ||
}, | ||
access: { | ||
create: isStaff, | ||
read: () => true, | ||
update: isStaff, | ||
delete: isStaff, | ||
}, | ||
fields: [ | ||
{ | ||
name: "id", | ||
type: "text", | ||
}, | ||
{ | ||
name: "name", | ||
type: "text", | ||
}, | ||
{ | ||
name: "checksum", | ||
type: "text", | ||
required: true, | ||
}, | ||
], | ||
}; |
Oops, something went wrong.