Skip to content

Commit

Permalink
fix: checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasm91 committed Mar 18, 2024
1 parent 2821ace commit 5580232
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
3 changes: 3 additions & 0 deletions server/e2e/jobs/specs/library-watcher.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe(`Library watcher (e2e)`, () => {
describe('Single import path', () => {
beforeEach(async () => {
await api.libraryApi.create(server, admin.accessToken, {
ownerId: admin.userId,
type: LibraryType.EXTERNAL,
importPaths: [`${IMMICH_TEST_ASSET_TEMP_PATH}`],
});
Expand Down Expand Up @@ -133,6 +134,7 @@ describe(`Library watcher (e2e)`, () => {
await fs.mkdir(`${IMMICH_TEST_ASSET_TEMP_PATH}/dir3`, { recursive: true });

await api.libraryApi.create(server, admin.accessToken, {
ownerId: admin.userId,
type: LibraryType.EXTERNAL,
importPaths: [
`${IMMICH_TEST_ASSET_TEMP_PATH}/dir1`,
Expand Down Expand Up @@ -190,6 +192,7 @@ describe(`Library watcher (e2e)`, () => {

beforeEach(async () => {
library = await api.libraryApi.create(server, admin.accessToken, {
ownerId: admin.userId,
type: LibraryType.EXTERNAL,
importPaths: [
`${IMMICH_TEST_ASSET_TEMP_PATH}/dir1`,
Expand Down
10 changes: 0 additions & 10 deletions server/src/infra/sql/access.repository.sql
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,6 @@ WHERE
)
AND ("LibraryEntity"."deletedAt" IS NULL)

-- AccessRepository.library.checkPartnerAccess
SELECT
"partner"."sharedById" AS "partner_sharedById",
"partner"."sharedWithId" AS "partner_sharedWithId"
FROM
"partners" "partner"
WHERE
"partner"."sharedById" IN ($1)
AND "partner"."sharedWithId" = $2

-- AccessRepository.person.checkOwnerAccess
SELECT
"PersonEntity"."id" AS "PersonEntity_id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
const dispatch = createEventDispatcher<{
cancel: void;
submit: { ownerId: string | null };
submit: { ownerId: string };
delete: void;
}>();
Expand Down
10 changes: 2 additions & 8 deletions web/src/routes/admin/library-management/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
removeOfflineFiles,
scanLibrary,
updateLibrary,
type CreateLibraryDto,
type LibraryResponseDto,
type LibraryStatsResponseDto,
type UserResponseDto,
Expand Down Expand Up @@ -117,14 +116,9 @@
}
}
const handleCreate = async (ownerId: string | null) => {
const handleCreate = async (ownerId: string) => {
try {
let createLibraryDto: CreateLibraryDto = { type: LibraryType.External };
if (ownerId) {
createLibraryDto = { ...createLibraryDto, ownerId };
}
const createdLibrary = await createLibrary({ createLibraryDto });
const createdLibrary = await createLibrary({ createLibraryDto: { ownerId, type: LibraryType.External } });
notificationController.show({
message: `Created library: ${createdLibrary.name}`,
Expand Down

0 comments on commit 5580232

Please sign in to comment.