Skip to content

Commit

Permalink
Merge pull request #975 from shawnrivers/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
shawnrivers authored Sep 26, 2020
2 parents 2eb3436 + aef9549 commit 3102f37
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 80 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 44 additions & 40 deletions src/data/members.json
Original file line number Diff line number Diff line change
Expand Up @@ -514,14 +514,14 @@
"bloodType": "a",
"origin": "Düsseldorf, Germany",
"sites": [
{
"title": "blog",
"url": "https://blog.nogizaka46.com/erika.ikuta/"
},
{
"title": "Instagram",
"url": "https://www.instagram.com/ikutaerika.official/"
},
{
"title": "blog",
"url": "https://blog.nogizaka46.com/erika.ikuta/"
},
{
"title": "Profile",
"url": "https://www.nogizaka46.com/member/detail/ikutaerika.php"
Expand Down Expand Up @@ -1524,14 +1524,14 @@
"bloodType": "ab",
"origin": "大分県",
"sites": [
{
"title": "Official",
"url": "https://etomisa.jp/"
},
{
"title": "Instagram",
"url": "https://www.instagram.com/misa_eto_official/"
},
{
"title": "Official",
"url": "https://etomisa.jp/"
},
{
"title": "Profile",
"url": "https://n46llc.com/s/m00/artist/10"
Expand Down Expand Up @@ -2391,7 +2391,8 @@
"members/singles/17/saitouyuuri.jpg",
"members/singles/20/saitouyuuri.jpg",
"members/singles/22/saitouyuuri.jpg",
"members/others/saitouyuuri_2020-04-29.jpg"
"members/others/saitouyuuri_2020-04-29.jpg",
"members/others/saitouyuuri_2020-09-26.jpg"
],
"singles": [
{
Expand Down Expand Up @@ -3205,6 +3206,10 @@
"bloodType": "a",
"origin": "群馬県",
"sites": [
{
"title": "YouTube",
"url": "https://www.youtube.com/c/maishiraishi"
},
{
"title": "blog",
"url": "https://blog.nogizaka46.com/mai.shiraishi/"
Expand All @@ -3213,10 +3218,6 @@
"title": "Profile",
"url": "https://www.nogizaka46.com/member/detail/shiraishimai.php"
},
{
"title": "YouTube",
"url": "https://www.youtube.com/c/maishiraishi"
},
{
"title": "755",
"url": "https://7gogo.jp/shiraishi-mai"
Expand Down Expand Up @@ -3577,14 +3578,14 @@
"bloodType": "a",
"origin": "千葉県",
"sites": [
{
"title": "blog",
"url": "https://blog.nogizaka46.com/kazumi.takayama/"
},
{
"title": "Instagram",
"url": "https://instagram.com/takayama.kazumi.official/"
},
{
"title": "blog",
"url": "https://blog.nogizaka46.com/kazumi.takayama/"
},
{
"title": "Profile",
"url": "https://www.nogizaka46.com/member/detail/takayamakazumi.php"
Expand Down Expand Up @@ -4253,14 +4254,14 @@
"bloodType": "o",
"origin": "大阪府",
"sites": [
{
"title": "Official",
"url": "https://nishinonanase.com/"
},
{
"title": "Instagram",
"url": "https://www.instagram.com/nishino.nanase.official/"
},
{
"title": "Official",
"url": "https://nishinonanase.com/"
},
{
"title": "Profile",
"url": "https://n46llc.com/s/m00/artist/7"
Expand Down Expand Up @@ -4465,7 +4466,8 @@
"members/singles/17/noujouami.jpg",
"members/singles/20/noujouami.jpg",
"members/singles/22/noujouami.jpg",
"members/others/noujouami_2020-04-29.jpg"
"members/others/noujouami_2020-04-29.jpg",
"members/others/noujouami_2020-09-26.jpg"
],
"singles": [
{
Expand Down Expand Up @@ -5545,14 +5547,14 @@
"bloodType": "b",
"origin": "大阪府",
"sites": [
{
"title": "blog",
"url": "https://blog.nogizaka46.com/sayuri.matsumura/"
},
{
"title": "Instagram",
"url": "https://www.instagram.com/matsumura_sayuri_official/"
},
{
"title": "blog",
"url": "https://blog.nogizaka46.com/sayuri.matsumura/"
},
{
"title": "Profile",
"url": "https://www.nogizaka46.com/member/detail/matsumurasayuri.php"
Expand Down Expand Up @@ -7303,7 +7305,8 @@
"members/singles/14/itoumarika.jpg",
"members/singles/15/itoumarika.jpg",
"members/singles/17/itoumarika.jpg",
"members/others/itoumarika_2020-04-29.jpg"
"members/others/itoumarika_2020-04-29.jpg",
"members/others/itoumarika_2020-09-26.jpg"
],
"singles": [
{
Expand Down Expand Up @@ -7446,14 +7449,14 @@
"bloodType": "o",
"origin": "神奈川県",
"sites": [
{
"title": "Official",
"url": "https://itomarika.com/"
},
{
"title": "Instagram",
"url": "https://www.instagram.com/marikaito_official/"
},
{
"title": "Official",
"url": "https://itomarika.com/"
},
{
"title": "Profile",
"url": "https://n46llc.com/s/m00/artist/3"
Expand Down Expand Up @@ -8087,13 +8090,13 @@
"bloodType": "o",
"origin": "静岡県",
"sites": [
{
"title": "Official",
"url": "https://fukagawamai.com/"
},
{
"title": "Instagram",
"url": "https://www.instagram.com/fukagawamai.official/"
},
{
"title": "Official",
"url": "https://fukagawamai.com/"
}
],
"photoAlbums": [
Expand Down Expand Up @@ -10427,14 +10430,14 @@
"bloodType": "o",
"origin": "千葉県",
"sites": [
{
"title": "Twitter",
"url": "https://twitter.com/seira_miyazawa/"
},
{
"title": "Instagram",
"url": "https://www.instagram.com/seira_miyazawa/"
},
{
"title": "Twitter",
"url": "https://twitter.com/seira_miyazawa/"
},
{
"title": "Ameba",
"url": "https://ameblo.jp/seira-miyazawa/"
Expand Down Expand Up @@ -14536,7 +14539,8 @@
"members/singles/14/sagaraiori.jpg",
"members/singles/15/sagaraiori.jpg",
"members/singles/17/sagaraiori.jpg",
"members/others/sagaraiori_2020-04-29.jpg"
"members/others/sagaraiori_2020-04-29.jpg",
"members/others/sagaraiori_2020-09-26.jpg"
],
"singles": [
{
Expand Down
19 changes: 17 additions & 2 deletions src/server/actors/Members/raw/creator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MemberRaw } from 'server/actors/Members/models';
import { sortBySocialMedia } from 'utils/arrays';

type CreateMemberRawParams = {
name: MemberRaw['name'];
Expand Down Expand Up @@ -27,7 +28,16 @@ type CreateMemberRawParams = {
graduatedDate?: string;
};

export const createMemberRaw = (params: CreateMemberRawParams): MemberRaw => {
type CreateMemberOptions = {
autoSortSites?: boolean;
};

export const createMemberRaw = (
params: CreateMemberRawParams,
options: CreateMemberOptions = {
autoSortSites: true,
}
): MemberRaw => {
const graduation =
params.graduatedDate !== undefined
? {
Expand Down Expand Up @@ -58,7 +68,12 @@ export const createMemberRaw = (params: CreateMemberRawParams): MemberRaw => {
height: params.height,
bloodType: params.bloodType,
origin: params.origin,
sites: params.sites ?? [],
sites:
params.sites === undefined
? []
: options.autoSortSites
? sortBySocialMedia(params.sites, 'asc')
: params.sites,
photoAlbums:
params.photoAlbums?.map(photoAlbum => ({
title: photoAlbum.title,
Expand Down
Loading

0 comments on commit 3102f37

Please sign in to comment.