diff --git a/database/migrations/2023_09_17_071311_create_english_language_record.php b/database/migrations/2023_09_17_071311_create_english_language_record.php index aafb7ba..6073e73 100644 --- a/database/migrations/2023_09_17_071311_create_english_language_record.php +++ b/database/migrations/2023_09_17_071311_create_english_language_record.php @@ -9,6 +9,7 @@ public function up(): void { DB::table('languages') ->insertOrIgnore([ + 'uuid' => Str::orderedUuid()->toString(), 'code' => 'en', 'name' => 'English', ]); diff --git a/resources/js/console/components/Input/Input.vue b/resources/js/console/components/Input/Input.vue index e6df619..099d4c3 100644 --- a/resources/js/console/components/Input/Input.vue +++ b/resources/js/console/components/Input/Input.vue @@ -9,7 +9,7 @@ v-if="type !== 'file'" v-bind="$attrs" :type="type" - class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" + class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6 disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200" :placeholder="placeholder" :value="modelValue" @input="onInput" @@ -18,7 +18,7 @@ v-else v-bind="$attrs" :type="type" - class="px-4 block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" + class="px-4 block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6 disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200" :placeholder="placeholder" @change="onInput" /> diff --git a/resources/js/console/repositories/language.repository.js b/resources/js/console/repositories/language.repository.js index c554a6b..0a41bb1 100644 --- a/resources/js/console/repositories/language.repository.js +++ b/resources/js/console/repositories/language.repository.js @@ -24,13 +24,23 @@ export const languageRepository = { }, /** - * * @param {{name: string, code: string}} data */ create(data) { return httpClient.post(`languages`, data).then(getData).catch(catchError); }, + /** + * @param {String} id + * @param {{name: String}} data + */ + update(id, data) { + return httpClient + .put(`languages/${id}`, data) + .then(getData) + .catch(catchError); + }, + destroy(id) { return httpClient.delete(`languages/${id}`).then(getData).catch(catchError); }, diff --git a/resources/js/console/screens/LanguagesList/LanguaguesListScreen.vue b/resources/js/console/screens/LanguagesList/LanguaguesListScreen.vue index cdd317c..50faca7 100644 --- a/resources/js/console/screens/LanguagesList/LanguaguesListScreen.vue +++ b/resources/js/console/screens/LanguagesList/LanguaguesListScreen.vue @@ -10,10 +10,16 @@ - + + + + @@ -26,6 +32,7 @@ import { ref } from 'vue'; import CreateNewLanguage from './components/CreateNewLanguage.vue'; import DeleteLanguageButton from './components/DeleteLanguageButton.vue'; import { languageRepository } from '../../repositories/language.repository'; +import UpdateLanguageButton from './components/UpdateLanguageButton.vue'; const columns = [ { diff --git a/resources/js/console/screens/LanguagesList/components/CreateNewLanguage.vue b/resources/js/console/screens/LanguagesList/components/CreateNewLanguage.vue index ef889ca..a29f178 100644 --- a/resources/js/console/screens/LanguagesList/components/CreateNewLanguage.vue +++ b/resources/js/console/screens/LanguagesList/components/CreateNewLanguage.vue @@ -1,7 +1,7 @@ Create New Language diff --git a/resources/js/console/screens/LanguagesList/components/UpdateLanguageButton.vue b/resources/js/console/screens/LanguagesList/components/UpdateLanguageButton.vue new file mode 100644 index 0000000..426e9af --- /dev/null +++ b/resources/js/console/screens/LanguagesList/components/UpdateLanguageButton.vue @@ -0,0 +1,104 @@ + + Update + + + + + + + + + + + Cancel + + + Update + + + + + + + + +