Skip to content

Commit 83073a8

Browse files
committed
api: Add publicationNames in getIssues() response
whattheduck: Bump version
1 parent 2781808 commit 83073a8

File tree

9 files changed

+27
-47
lines changed

9 files changed

+27
-47
lines changed

apps/web/src/stores/collection.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ export const collection = defineStore("collection", () => {
166166
await collectionServices.deletePurchase(id);
167167
await loadPurchases(true);
168168
},
169-
fetchPublicationNames = () => collectionServices.getPublicationTitles(),
170169
loadPreviousVisit = async () => {
171170
const result = await collectionServices.getLastVisit();
172171
if (typeof result === "object" && result?.error) {
@@ -178,11 +177,14 @@ export const collection = defineStore("collection", () => {
178177
loadCollection = async (afterUpdate = false) => {
179178
if (afterUpdate || (!isLoadingCollection.value && !issues.value)) {
180179
isLoadingCollection.value = true;
180+
let publicationNames: Record<string, string> = {};
181181
({
182182
issues: issues.value,
183183
countByCountrycode: coaIssueCountsPerCountrycode.value,
184184
countByPublicationcode: coaIssueCountsByPublicationcode.value,
185+
publicationNames,
185186
} = await collectionServices.getIssues());
187+
coa().addPublicationNames(publicationNames);
186188
Object.assign(
187189
coa().issuecodeDetails,
188190
issues.value.map(({ issuecode, publicationcode, issuenumber }) => ({
@@ -374,7 +376,6 @@ export const collection = defineStore("collection", () => {
374376
publicationUrlRoot,
375377
createPurchase,
376378
deletePurchase,
377-
fetchPublicationNames,
378379
hasRole,
379380
hasSuggestions,
380381
isLoadingUser,

apps/whattheduck/android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "net.ducksmanager.whattheduck3"
88
minSdkVersion rootProject.ext.minSdkVersion
99
targetSdkVersion rootProject.ext.targetSdkVersion
10-
versionCode 116
11-
versionName "3.0.7"
10+
versionCode 117
11+
versionName "3.0.8"
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
aaptOptions {
1414
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

apps/whattheduck/android/capacitor.settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ include ':capawesome-capacitor-file-picker'
3636
project(':capawesome-capacitor-file-picker').projectDir = new File('../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capawesome/capacitor-file-picker/android')
3737

3838
include ':capgo-capacitor-updater'
39-
project(':capgo-capacitor-updater').projectDir = new File('../../../node_modules/.pnpm/@[email protected].4_@[email protected]/node_modules/@capgo/capacitor-updater/android')
39+
project(':capgo-capacitor-updater').projectDir = new File('../../../node_modules/.pnpm/@[email protected].5_@[email protected]/node_modules/@capgo/capacitor-updater/android')

apps/whattheduck/ios/App/App.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,15 +366,15 @@
366366
buildSettings = {
367367
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
368368
CODE_SIGN_STYLE = Automatic;
369-
CURRENT_PROJECT_VERSION = 116;
369+
CURRENT_PROJECT_VERSION = 117;
370370
DEVELOPMENT_TEAM = ZHTS8HRVD7;
371371
INFOPLIST_FILE = App/Info.plist;
372372
IPHONEOS_DEPLOYMENT_TARGET = 13.1;
373373
LD_RUNPATH_SEARCH_PATHS = (
374374
"$(inherited)",
375375
"@executable_path/Frameworks",
376376
);
377-
MARKETING_VERSION = 3.0.7;
377+
MARKETING_VERSION = 3.0.8;
378378
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
379379
PRODUCT_BUNDLE_IDENTIFIER = net.ducksmanager.whattheduck;
380380
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -390,15 +390,15 @@
390390
buildSettings = {
391391
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
392392
CODE_SIGN_STYLE = Automatic;
393-
CURRENT_PROJECT_VERSION = 116;
393+
CURRENT_PROJECT_VERSION = 117;
394394
DEVELOPMENT_TEAM = ZHTS8HRVD7;
395395
INFOPLIST_FILE = App/Info.plist;
396396
IPHONEOS_DEPLOYMENT_TARGET = 13.1;
397397
LD_RUNPATH_SEARCH_PATHS = (
398398
"$(inherited)",
399399
"@executable_path/Frameworks",
400400
);
401-
MARKETING_VERSION = 3.0.7;
401+
MARKETING_VERSION = 3.0.8;
402402
PRODUCT_BUNDLE_IDENTIFIER = net.ducksmanager.whattheduck;
403403
PRODUCT_NAME = "$(TARGET_NAME)";
404404
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";

apps/whattheduck/ios/App/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def capacitor_pods
2222
pod 'CapacitorStatusBar', :path => '../../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/status-bar'
2323
pod 'CapawesomeCapacitorAppUpdate', :path => '../../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capawesome/capacitor-app-update'
2424
pod 'CapawesomeCapacitorFilePicker', :path => '../../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capawesome/capacitor-file-picker'
25-
pod 'CapgoCapacitorUpdater', :path => '../../../../node_modules/.pnpm/@[email protected].4_@[email protected]/node_modules/@capgo/capacitor-updater'
25+
pod 'CapgoCapacitorUpdater', :path => '../../../../node_modules/.pnpm/@[email protected].5_@[email protected]/node_modules/@capgo/capacitor-updater'
2626
end
2727

2828
target 'What The Duck' do

apps/whattheduck/ios/App/Podfile.lock

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,17 @@ PODS:
2727
- Capacitor
2828
- CapawesomeCapacitorFilePicker (6.0.1):
2929
- Capacitor
30-
- CapgoCapacitorUpdater (6.2.4):
30+
- CapgoCapacitorUpdater (6.2.5):
3131
- Alamofire
3232
- Capacitor
3333
- SSZipArchive
34-
- SwiftyRSA
3534
- Version
3635
- SQLCipher (4.6.0):
3736
- SQLCipher/standard (= 4.6.0)
3837
- SQLCipher/common (4.6.0)
3938
- SQLCipher/standard (4.6.0):
4039
- SQLCipher/common
4140
- SSZipArchive (2.4.3)
42-
- SwiftyRSA (1.7.0):
43-
- SwiftyRSA/ObjC (= 1.7.0)
44-
- SwiftyRSA/ObjC (1.7.0)
4541
- Version (0.8.0)
4642
- ZIPFoundation (0.9.19)
4743

@@ -59,14 +55,13 @@ DEPENDENCIES:
5955
- "CapacitorStatusBar (from `../../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/status-bar`)"
6056
- "CapawesomeCapacitorAppUpdate (from `../../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capawesome/capacitor-app-update`)"
6157
- "CapawesomeCapacitorFilePicker (from `../../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capawesome/capacitor-file-picker`)"
62-
- "CapgoCapacitorUpdater (from `../../../../node_modules/.pnpm/@[email protected].4_@[email protected]/node_modules/@capgo/capacitor-updater`)"
58+
- "CapgoCapacitorUpdater (from `../../../../node_modules/.pnpm/@[email protected].5_@[email protected]/node_modules/@capgo/capacitor-updater`)"
6359

6460
SPEC REPOS:
6561
trunk:
6662
- Alamofire
6763
- SQLCipher
6864
- SSZipArchive
69-
- SwiftyRSA
7065
- Version
7166
- ZIPFoundation
7267

@@ -98,7 +93,7 @@ EXTERNAL SOURCES:
9893
CapawesomeCapacitorFilePicker:
9994
:path: "../../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capawesome/capacitor-file-picker"
10095
CapgoCapacitorUpdater:
101-
:path: "../../../../node_modules/.pnpm/@[email protected].4_@[email protected]/node_modules/@capgo/capacitor-updater"
96+
:path: "../../../../node_modules/.pnpm/@[email protected].5_@[email protected]/node_modules/@capgo/capacitor-updater"
10297

10398
SPEC CHECKSUMS:
10499
Alamofire: f36a35757af4587d8e4f4bfa223ad10be2422b8c
@@ -115,13 +110,12 @@ SPEC CHECKSUMS:
115110
CapacitorStatusBar: b81d4fb5d4e0064c712018071b3ab4b810b39a63
116111
CapawesomeCapacitorAppUpdate: 3c05b5c8e42f9c6a88d666093406e9336d9bfdb1
117112
CapawesomeCapacitorFilePicker: c80c30759ba48986ff34a2b51b23ac2babfd3774
118-
CapgoCapacitorUpdater: 96ddeff53957d088973ab80fff635cf560fab7a0
113+
CapgoCapacitorUpdater: 5cf2afb1f57842d2075a7f114e9de447e132298f
119114
SQLCipher: 30a8e81afa6128e600b17ffa77d0f92fa05ed208
120115
SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef
121-
SwiftyRSA: 8c6dd1ea7db1b8dc4fb517a202f88bb1354bc2c6
122116
Version: de5907f2c5d0f3cf21708db7801d1d5401139486
123117
ZIPFoundation: b8c29ea7ae353b309bc810586181fd073cb3312c
124118

125-
PODFILE CHECKSUM: 74611ffb56453c4d546e84626f0f58154d558c34
119+
PODFILE CHECKSUM: b9fa90a1accb2442067420f77c64ce80a75e2ce6
126120

127121
COCOAPODS: 1.15.2

apps/whattheduck/src/stores/wtdcollection.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const wtdcollection = defineStore('wtdcollection', () => {
1616
const {
1717
createPurchase,
1818
findInCollection,
19-
fetchPublicationNames,
2019
isLoadingSuggestions,
2120
loadCollection,
2221
loadPurchases,
@@ -65,7 +64,6 @@ export const wtdcollection = defineStore('wtdcollection', () => {
6564
await loadPurchases(force);
6665
await loadUser(force);
6766
await coaStore.fetchCountryNames(true);
68-
coaStore.addPublicationNames(await fetchPublicationNames());
6967
await usersStore.fetchStats([webCollectionStore.user?.id || 0], force);
7068
// TODO retrieve user notification countries
7169

packages/api/services/collection/issues/index.ts

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,7 @@ const getCoaCountByCountrycode = (collectionCountrycodes: string[]) =>
6767
),
6868
);
6969

70-
export const getCollectionCountrycodes = (issues: issue[]) => [
71-
...new Set(
72-
getCollectionPublicationcodes(issues).map(
73-
(publicationcode) => publicationcode.split("/")[0],
74-
),
75-
),
76-
];
77-
78-
export const getCollectionPublicationcodes = (issues: issue[]) => [
79-
...new Set(issues.map(({ publicationcode }) => publicationcode!)),
80-
];
81-
8270
export default (socket: Socket<Events>) => {
83-
socket.on("getPublicationTitles", async (callback) =>
84-
getPublicationTitles({
85-
publicationcode: {
86-
in: await getCollectionPublicationcodes(socket.data.user!.id),
87-
},
88-
}).then(callback),
89-
);
9071
socket.on("getIssues", async (callback) => {
9172
if (socket.data.user!.username === "demo") {
9273
await resetDemo();
@@ -127,6 +108,11 @@ export default (socket: Socket<Events>) => {
127108
countByPublicationcode: await getCoaCountByPublicationcode(
128109
collectionPublicationcodes,
129110
),
111+
publicationNames: await getPublicationTitles({
112+
publicationcode: {
113+
in: collectionPublicationcodes,
114+
},
115+
})
130116
};
131117
})
132118
.then(callback);

packages/api/services/collection/types.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ export default abstract class {
4646
) => void;
4747

4848
abstract getIssues: (
49-
callback: (data: {countByCountrycode: Record<string, number>, countByPublicationcode: Record<string, number>, issues: AugmentedIssue<issue & { issuecode: string }>[]}) => void,
49+
callback: (data: {
50+
countByCountrycode: Record<string, number>,
51+
countByPublicationcode: Record<string, number>,
52+
publicationNames: Record<string, string>,
53+
issues: AugmentedIssue<issue & { issuecode: string }>[]
54+
}) => void,
5055
) => void;
5156
abstract addOrChangeIssues: (
5257
data: CollectionUpdateMultipleIssues,
@@ -57,10 +62,6 @@ export default abstract class {
5762
callback: (data: TransactionResults) => void,
5863
) => void;
5964

60-
abstract getPublicationTitles: (
61-
callback: (value: Record<string, string>) => void,
62-
) => void;
63-
6465
abstract createRequests: (
6566
issueIds: number[],
6667
callback: (

0 commit comments

Comments
 (0)