2 Commits

Author SHA1 Message Date
Sonny
af08964fcc chore: release v3.1.1 2025-01-21 18:16:03 +01:00
Sonny
151ac0602a fix: "cannot remove collection" related to unused stuff 2025-01-21 18:15:08 +01:00
9 changed files with 23 additions and 11 deletions

View File

@@ -15,9 +15,6 @@ export default class Collection extends AppBaseModel {
@column()
declare visibility: Visibility;
@column()
declare nextId: number;
@column()
declare authorId: number;

View File

@@ -6,7 +6,6 @@ export const createCollectionValidator = vine.compile(
name: vine.string().trim().minLength(1).maxLength(254),
description: vine.string().trim().maxLength(254).nullable(),
visibility: vine.enum(Visibility),
nextId: vine.number().optional(),
})
);

View File

@@ -7,7 +7,6 @@ export const updateCollectionValidator = vine.compile(
name: vine.string().trim().minLength(1).maxLength(254),
description: vine.string().trim().maxLength(254).nullable(),
visibility: vine.enum(Visibility),
nextId: vine.number().optional(),
params,
})

View File

@@ -0,0 +1,21 @@
import { BaseSchema } from '@adonisjs/lucid/schema';
export default class extends BaseSchema {
protected tableName = 'collections';
async up() {
this.schema.alterTable('collections', (table) => {
table.dropColumn('next_id');
});
}
async down() {
this.schema.alterTable('collections', (table) => {
table
.integer('next_id')
.references('id')
.inTable('collections')
.defaultTo(null);
});
}
}

View File

@@ -34,7 +34,6 @@ function createRandomCollection(userIds: User['id'][]) {
name: faker.string.alphanumeric({ length: { min: 5, max: 25 } }),
description: faker.string.alphanumeric({ length: { min: 0, max: 254 } }),
visibility: Visibility.PRIVATE,
nextId: collectionId + 1,
authorId,
};
}

View File

@@ -3,13 +3,12 @@ import { FormEvent } from 'react';
import { useTranslation } from 'react-i18next';
import BackToDashboard from '~/components/common/navigation/back_to_dashboard';
import { FormLayout, FormLayoutProps } from '~/layouts/form_layout';
import { Collection, Visibility } from '~/types/app';
import { Visibility } from '~/types/app';
export type FormCollectionData = {
name: string;
description: string | null;
visibility: Visibility;
nextId?: Collection['id'];
};
interface FormCollectionProps extends FormLayoutProps {

View File

@@ -18,7 +18,6 @@ export default function EditCollectionPage({
name: collection.name,
description: collection.description,
visibility: collection.visibility,
nextId: collection.nextId,
});
const canSubmit = useMemo<boolean>(() => {
const trimmedName = data.name.trim();

View File

@@ -49,7 +49,6 @@ export type Collection = CommonBase & {
name: string;
description: string | null;
visibility: Visibility;
nextId: number;
authorId: number;
};

View File

@@ -1,6 +1,6 @@
{
"name": "my-links",
"version": "3.1.0",
"version": "3.1.1",
"type": "module",
"license": "GPL-3.0-only",
"scripts": {